From 98bdbc5ffd928855f0edd9c32506c8199bd3d1eb Mon Sep 17 00:00:00 2001 From: "Vladimir.Sushchen" Date: Tue, 19 Oct 2021 15:18:18 +0300 Subject: [PATCH 1/8] add homework to project, all worked, tests written --- .eslintrc.json | 29 ++++++ README.md | 19 +++- babel.config.json | 18 ++++ index.js | 4 +- jest.config.js | 10 +- src/index.js | 4 +- src/lesson2/engine.js | 114 +++++++++++++++++++++ src/lesson2/engine.js.map | 1 + src/lesson2/engine.test.js | 80 +++++++++++++++ src/lesson2/engine.test.js.map | 1 + src/lesson2/engine.test.ts | 140 ++++++++++++++++++-------- src/lesson2/engine.ts | 124 ++++++++++++++++++----- src/lesson2/helpers.js | 5 + src/lesson2/helpers.js.map | 1 + src/lesson2/helpers.ts | 2 +- src/lesson2/index.js | 74 ++++++++++++++ src/lesson2/index.js.map | 1 + src/lesson2/index.ts | 26 ++--- src/lesson2/mathOperators.js | 37 +++++++ src/lesson2/mathOperators.js.map | 1 + src/lesson2/mathOperators.test.js | 45 +++++++++ src/lesson2/mathOperators.test.js.map | 1 + src/lesson2/mathOperators.test.ts | 70 +++++++++---- src/lesson2/mathOperators.ts | 53 +++++++--- src/lesson2/parser.js | 72 +++++++++++++ src/lesson2/parser.js.map | 1 + src/lesson2/parser.test.js | 37 +++++++ src/lesson2/parser.test.js.map | 1 + src/lesson2/parser.test.ts | 72 ++++++++----- src/lesson2/parser.ts | 85 +++++++++++++--- src/lesson2/runner.js | 17 ++++ src/lesson2/runner.js.map | 1 + src/lesson2/runner.test.js | 69 +++++++++++++ src/lesson2/runner.test.js.map | 1 + src/lesson2/runner.test.ts | 122 +++++++++++++++------- src/lesson2/runner.ts | 19 ++-- tsconfig.json | 11 ++ webpack.config.js | 15 +++ 38 files changed, 1164 insertions(+), 219 deletions(-) create mode 100644 .eslintrc.json create mode 100644 babel.config.json create mode 100644 src/lesson2/engine.js create mode 100644 src/lesson2/engine.js.map create mode 100644 src/lesson2/engine.test.js create mode 100644 src/lesson2/engine.test.js.map create mode 100644 src/lesson2/helpers.js create mode 100644 src/lesson2/helpers.js.map create mode 100644 src/lesson2/index.js create mode 100644 src/lesson2/index.js.map create mode 100644 src/lesson2/mathOperators.js create mode 100644 src/lesson2/mathOperators.js.map create mode 100644 src/lesson2/mathOperators.test.js create mode 100644 src/lesson2/mathOperators.test.js.map create mode 100644 src/lesson2/parser.js create mode 100644 src/lesson2/parser.js.map create mode 100644 src/lesson2/parser.test.js create mode 100644 src/lesson2/parser.test.js.map create mode 100644 src/lesson2/runner.js create mode 100644 src/lesson2/runner.js.map create mode 100644 src/lesson2/runner.test.js create mode 100644 src/lesson2/runner.test.js.map create mode 100644 tsconfig.json create mode 100644 webpack.config.js diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..d158a12 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,29 @@ +{ + "env": { + "browser": true, + "es6": true, + "jest": true + }, + "extends": [ + "plugin:react/recommended", + "standard" + ], + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 2018, + "sourceType": "module" + }, + "plugins": [ + "react", + "@typescript-eslint" + ], + "rules": { + } +} \ No newline at end of file diff --git a/README.md b/README.md index 343e195..7b67276 100644 --- a/README.md +++ b/README.md @@ -1 +1,18 @@ -# react-otus-homework \ No newline at end of file +# react-otus-homework + +Для домашнего задания использован репозиторий +https://github.com/nickovchinnikov/react-js-tutorial/pull/3 +код из папки src/lesson2 + + +Добавлена поддержка математических операторов: + + возведение в квадрат ** + возведение в степень ^ + факториал ! + +Добавлена обработка скобок, в том числе вложенных +пример: (2 + 2) * 2 = 8 + +Добавлена обработка текста без пробелов, формулы можно вводить прямым текстом +Добавлены тесты \ No newline at end of file diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 0000000..6f17a50 --- /dev/null +++ b/babel.config.json @@ -0,0 +1,18 @@ +{ + "presets": [ + [ + "@babel/env", + { + "targets": { + "edge": "17", + "firefox": "60", + "chrome": "67", + "safari": "11.1" + }, + "useBuiltIns": "usage", + "corejs": "3.6.5" + } + ], + "@babel/preset-typescript" + ] +} diff --git a/index.js b/index.js index fa69a5a..ab1ee13 100644 --- a/index.js +++ b/index.js @@ -1,2 +1,2 @@ -"use strict"; -//# sourceMappingURL=index.js.map \ No newline at end of file +'use strict' +// # sourceMappingURL=index.js.map diff --git a/jest.config.js b/jest.config.js index d8491f5..e17873d 100644 --- a/jest.config.js +++ b/jest.config.js @@ -3,9 +3,9 @@ module.exports = { clearMocks: true, - coverageDirectory: "coverage", - testEnvironment: "node", + coverageDirectory: 'coverage', + testEnvironment: 'node', transform: { - "^.+\\.(js|jsx|ts|tsx)$": "/node_modules/babel-jest", - }, -}; + '^.+\\.(js|jsx|ts|tsx)$': '/node_modules/babel-jest' + } +} diff --git a/src/index.js b/src/index.js index fa69a5a..ab1ee13 100644 --- a/src/index.js +++ b/src/index.js @@ -1,2 +1,2 @@ -"use strict"; -//# sourceMappingURL=index.js.map \ No newline at end of file +'use strict' +// # sourceMappingURL=index.js.map diff --git a/src/lesson2/engine.js b/src/lesson2/engine.js new file mode 100644 index 0000000..f536199 --- /dev/null +++ b/src/lesson2/engine.js @@ -0,0 +1,114 @@ +'use strict' +const __spreadArrays = (this && this.__spreadArrays) || function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length + for (var r = Array(s), k = 0, i = 0; i < il; i++) { + for (let a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) { r[k] = a[j] } + } + return r +} +Object.defineProperty(exports, '__esModule', { value: true }) +exports.thirdPrioritiesCalc = exports.secondPrioritiesCalc = exports.firstPrioritiesCalc = exports.calcWithPriorities = exports.bracketExprCalc = void 0 +const helpers_1 = require('./helpers') +const mathOperators_1 = require('./mathOperators') +const FIRST = mathOperators_1.mathPriorities[0]; const SECOND = mathOperators_1.mathPriorities[1]; const THIRD = mathOperators_1.mathPriorities[2] +exports.bracketExprCalc = function (stack) { + const result = [] + const listInnerBrackets = [] + const openBracketStack = [] + let temp + for (let i = 0; i < stack.length; i++) { + if (stack[i] === '(') { + openBracketStack.push(i) + temp = [] + listInnerBrackets.push(temp) + } else if (stack[i] === ')') { + const positionLastOpenBracket = openBracketStack.pop() + if (positionLastOpenBracket == null) { + throw new TypeError('Unexpected stack! Unexpected Bracket!') + } + const exprInBracket = listInnerBrackets.pop() + if (exprInBracket !== undefined) { + const valueInBracket = exports.calcWithPriorities(exprInBracket) + if (listInnerBrackets.length === 0) { + result.push(valueInBracket) + } else { + var outerBracketExpr = listInnerBrackets[listInnerBrackets.length - 1] + if (outerBracketExpr !== undefined) { + outerBracketExpr.push(valueInBracket) + } + } + } + } else if (openBracketStack.length > 0) { + var outerBracketExpr = listInnerBrackets[listInnerBrackets.length - 1] + if (outerBracketExpr !== undefined) { + outerBracketExpr.push(stack[i]) + } + } else { + result.push(stack[i]) + } + } + return result +} +exports.calcWithPriorities = function (bracketExprRes) { + const firstPrioritiesRes = exports.firstPrioritiesCalc(bracketExprRes) + if (firstPrioritiesRes.length === 1) { + return Number(firstPrioritiesRes[0]) + } + const secondPrioritiesRes = exports.secondPrioritiesCalc(firstPrioritiesRes) + if (secondPrioritiesRes.length === 1) { + return Number(secondPrioritiesRes[0]) + } + return exports.thirdPrioritiesCalc(secondPrioritiesRes) +} +exports.firstPrioritiesCalc = function (stack) { + return stack.reduce(function (result, nextItem) { + const prevItem = result[result.length - 2] + const item = result[result.length - 1] + if ((!helpers_1.isNumber(String(item)) && mathOperators_1.mathOperatorsPriorities[item] === FIRST) || + (helpers_1.isNumber(String(item)) && (mathOperators_1.mathOperatorsPriorities[nextItem] === FIRST) && + (nextItem === '**' || nextItem === '!'))) { + if (nextItem === '**' || nextItem === '!') { + result = __spreadArrays(result.slice(0, -1), [ + mathOperators_1.mathOperators[nextItem](Number(item), Number(item)) + ]) + } else { + result = __spreadArrays(result.slice(0, -2), [ + mathOperators_1.mathOperators[item](Number(prevItem), Number(nextItem)) + ]) + } + } else { + result.push(nextItem) + } + return result + }, []) +} +exports.secondPrioritiesCalc = function (stack) { + return stack.reduce(function (result, nextItem) { + const prevItem = result[result.length - 2] + const item = result[result.length - 1] + if (!helpers_1.isNumber(String(item)) && mathOperators_1.mathOperatorsPriorities[item] === SECOND) { + if (!mathOperators_1.mathOperators[item]) { + throw new TypeError('Unexpected stack!') + } + result = __spreadArrays(result.slice(0, -2), [ + mathOperators_1.mathOperators[item](Number(prevItem), Number(nextItem)) + ]) + } else { + result.push(nextItem) + } + return result + }, []) +} +exports.thirdPrioritiesCalc = function (stack) { + return stack.reduce(function (result, nextItem, key) { + const item = stack[key - 1] + if (mathOperators_1.mathOperatorsPriorities[item] === FIRST || mathOperators_1.mathOperatorsPriorities[item] === SECOND) { + throw new TypeError('Unexpected stack!') + } + if (!helpers_1.isNumber(String(item)) && mathOperators_1.mathOperatorsPriorities[item] === THIRD) { + result = mathOperators_1.mathOperators[item](Number(result), Number(nextItem)) + } + return result + }, Number(stack[0])) +} +// # sourceMappingURL=engine.js.map diff --git a/src/lesson2/engine.js.map b/src/lesson2/engine.js.map new file mode 100644 index 0000000..f1474f3 --- /dev/null +++ b/src/lesson2/engine.js.map @@ -0,0 +1 @@ +{"version":3,"file":"engine.js","sourceRoot":"","sources":["engine.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/src/lesson2/engine.test.js b/src/lesson2/engine.test.js new file mode 100644 index 0000000..89d5e97 --- /dev/null +++ b/src/lesson2/engine.test.js @@ -0,0 +1,80 @@ +'use strict' +Object.defineProperty(exports, '__esModule', { value: true }) +const engine_1 = require('./engine') +describe('firstPrioritiesCalc simple cases', function () { + it('[2, "!"]', function () { + expect(engine_1.firstPrioritiesCalc([2, '**'])).toEqual([4]) + }) + it('[5, "!"]', function () { + expect(engine_1.firstPrioritiesCalc([5, '**'])).toEqual([25]) + }) + it('[1, "!"]', function () { + expect(engine_1.firstPrioritiesCalc([1, '!'])).toEqual([1]) + }) + it('[0, "!"]', function () { + expect(engine_1.firstPrioritiesCalc([0, '!'])).toEqual([1]) + }) + it('[5, "!"]', function () { + expect(engine_1.firstPrioritiesCalc([5, '!'])).toEqual([120]) + }) + it('[5, "^",3]', function () { + expect(engine_1.firstPrioritiesCalc([5, '^', 3])).toEqual([125]) + }) + it('[6, "^",6]', function () { + expect(engine_1.firstPrioritiesCalc([6, '^', 6])).toEqual([46656]) + }) +}) +describe('secondPrioritiesCalc simple cases', function () { + it('[1, * 32]', function () { + expect(engine_1.secondPrioritiesCalc([1, '*', 32])).toEqual([32]) + }) + it('[32, /, 32]', function () { + expect(engine_1.secondPrioritiesCalc([32, '/', 32])).toEqual([1]) + }) + it('[32, + 32]', function () { + expect(engine_1.secondPrioritiesCalc([32, '+', 32])).toEqual([32, '+', 32]) + }) +}) +describe('secondPrioritiesCalc mixed with second priorities cases', function () { + it('[32, /, 32, +, 10, *, 10]', function () { + expect(engine_1.secondPrioritiesCalc([32, '/', 32, '+', 10, '*', 10])).toEqual([ + 1, + '+', + 100 + ]) + }) +}) +describe('thirdPrioritiesCalc invalid cases', function () { + it('[32, / 32]', function () { + expect(function () { return engine_1.thirdPrioritiesCalc([32, '/', 32]) }).toThrow(TypeError('Unexpected stack!')) + }) +}) +describe('thirdPrioritiesCalc simple cases', function () { + it('[32, + 32]', function () { + expect(engine_1.thirdPrioritiesCalc([32, '+', 32])).toEqual(64) + }) + it('[32, - 32]', function () { + expect(engine_1.thirdPrioritiesCalc([32, '-', 32])).toEqual(0) + }) + it('[32, - 32, +, 10]', function () { + expect(engine_1.thirdPrioritiesCalc([32, '-', 32, '+', 10])).toEqual(10) + }) + it('[32, - 32, +, 10]', function () { + expect(engine_1.thirdPrioritiesCalc([32, '-', 32, '+', 10])).toEqual(10) + }) + it('[32, - 32, +, 10]', function () { + expect(engine_1.thirdPrioritiesCalc([32, '-', 32, '+', 10])).toEqual(10) + }) +}) +describe('bracketExprCalc invalid cases', function () { + it(') (', function () { + expect(function () { return engine_1.bracketExprCalc([')', '(']) }).toThrow(TypeError('Unexpected stack! Unexpected Bracket!')) + }) + it('( ) (', function () { + expect(function () { return engine_1.bracketExprCalc(['(', ')', ')']) }).toThrow(TypeError('Unexpected stack! Unexpected Bracket!')) + }) + it('( ) ( ) )', function () { + expect(function () { return engine_1.bracketExprCalc(['(', ')', ')', ')', ')']) }).toThrow(TypeError('Unexpected stack! Unexpected Bracket!')) + }) +}) +// # sourceMappingURL=engine.test.js.map diff --git a/src/lesson2/engine.test.js.map b/src/lesson2/engine.test.js.map new file mode 100644 index 0000000..4c255e6 --- /dev/null +++ b/src/lesson2/engine.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"engine.test.js","sourceRoot":"","sources":["engine.test.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/src/lesson2/engine.test.ts b/src/lesson2/engine.test.ts index eae1cc0..e62aa92 100644 --- a/src/lesson2/engine.test.ts +++ b/src/lesson2/engine.test.ts @@ -1,47 +1,103 @@ -import { firstPrioritiesCalc, secondPrioritiesCalc } from "./engine"; +import { bracketExprCalc, firstPrioritiesCalc, secondPrioritiesCalc, thirdPrioritiesCalc } from './engine' -describe("firstPrioritiesCalc simple cases", () => { - it("[1, * 32]", () => { - expect(firstPrioritiesCalc([1, "*", 32])).toEqual([32]); - }); +describe('firstPrioritiesCalc simple cases', () => { + it('[2, "!"]', () => { + expect(firstPrioritiesCalc([2, '**'])).toEqual([4]) + }) - it("[32, /, 32]", () => { - expect(firstPrioritiesCalc([32, "/", 32])).toEqual([1]); - }); + it('[5, "!"]', () => { + expect(firstPrioritiesCalc([5, '**'])).toEqual([25]) + }) - it("[32, + 32]", () => { - expect(firstPrioritiesCalc([32, "+", 32])).toEqual([32, "+", 32]); - }); -}); + it('[1, "!"]', () => { + expect(firstPrioritiesCalc([1, '!'])).toEqual([1]) + }) -describe("firstPrioritiesCalc mixed with second priorities cases", () => { - it("[32, /, 32, +, 10, *, 10]", () => { - expect(firstPrioritiesCalc([32, "/", 32, "+", 10, "*", 10])).toEqual([ + it('[0, "!"]', () => { + expect(firstPrioritiesCalc([0, '!'])).toEqual([1]) + }) + + it('[5, "!"]', () => { + expect(firstPrioritiesCalc([5, '!'])).toEqual([120]) + }) + + it('[5, "^",3]', () => { + expect(firstPrioritiesCalc([5, '^', 3])).toEqual([125]) + }) + + it('[6, "^",6]', () => { + expect(firstPrioritiesCalc([6, '^', 6])).toEqual([46656]) + }) +}) + +describe('secondPrioritiesCalc simple cases', () => { + it('[1, * 32]', () => { + expect(secondPrioritiesCalc([1, '*', 32])).toEqual([32]) + }) + + it('[32, /, 32]', () => { + expect(secondPrioritiesCalc([32, '/', 32])).toEqual([1]) + }) + + it('[32, + 32]', () => { + expect(secondPrioritiesCalc([32, '+', 32])).toEqual([32, '+', 32]) + }) +}) + +describe('secondPrioritiesCalc mixed with second priorities cases', () => { + it('[32, /, 32, +, 10, *, 10]', () => { + expect(secondPrioritiesCalc([32, '/', 32, '+', 10, '*', 10])).toEqual([ 1, - "+", - 100, - ]); - }); -}); - -describe("secondPrioritiesCalc invalid cases", () => { - it("[32, / 32]", () => { - expect(() => secondPrioritiesCalc([32, "/", 32])).toThrow( - TypeError("Unexpected stack!") - ); - }); -}); - -describe("secondPrioritiesCalc simple cases", () => { - it("[32, + 32]", () => { - expect(secondPrioritiesCalc([32, "+", 32])).toEqual(64); - }); - - it("[32, - 32]", () => { - expect(secondPrioritiesCalc([32, "-", 32])).toEqual(0); - }); - - it("[32, - 32, +, 10]", () => { - expect(secondPrioritiesCalc([32, "-", 32, "+", 10])).toEqual(10); - }); -}); + '+', + 100 + ]) + }) +}) + +describe('thirdPrioritiesCalc invalid cases', () => { + it('[32, / 32]', () => { + expect(() => thirdPrioritiesCalc([32, '/', 32])).toThrow( + TypeError('Unexpected stack!') + ) + }) +}) + +describe('thirdPrioritiesCalc simple cases', () => { + it('[32, + 32]', () => { + expect(thirdPrioritiesCalc([32, '+', 32])).toEqual(64) + }) + + it('[32, - 32]', () => { + expect(thirdPrioritiesCalc([32, '-', 32])).toEqual(0) + }) + + it('[32, - 32, +, 10]', () => { + expect(thirdPrioritiesCalc([32, '-', 32, '+', 10])).toEqual(10) + }) + + it('[32, - 32, +, 10]', () => { + expect(thirdPrioritiesCalc([32, '-', 32, '+', 10])).toEqual(10) + }) + + it('[32, - 32, +, 10]', () => { + expect(thirdPrioritiesCalc([32, '-', 32, '+', 10])).toEqual(10) + }) +}) + +describe('bracketExprCalc invalid cases', () => { + it(') (', () => { + expect(() => bracketExprCalc([')', '('])).toThrow( + TypeError('Unexpected stack! Unexpected Bracket!') + ) + }) + it('( ) (', () => { + expect(() => bracketExprCalc(['(', ')', ')'])).toThrow( + TypeError('Unexpected stack! Unexpected Bracket!') + ) + }) + it('( ) ( ) )', () => { + expect(() => bracketExprCalc(['(', ')', ')', ')', ')'])).toThrow( + TypeError('Unexpected stack! Unexpected Bracket!') + ) + }) +}) diff --git a/src/lesson2/engine.ts b/src/lesson2/engine.ts index 78aee1d..d1ab17c 100644 --- a/src/lesson2/engine.ts +++ b/src/lesson2/engine.ts @@ -1,42 +1,116 @@ -import { ParsedLineType } from "./parser"; -import { isNumber } from "./helpers"; -import { - mathOperators, - mathPriorities, - mathOperatorsPriorities, -} from "./mathOperators"; +import { ParsedLineType } from './parser' +import { isNumber } from './helpers' +import { mathOperators, mathOperatorsPriorities, mathPriorities } from './mathOperators' -const [FIRST, SECOND] = mathPriorities; +const [FIRST, SECOND, THIRD] = mathPriorities + +export const bracketExprCalc = (stack: ParsedLineType): ParsedLineType => { + const result: ParsedLineType = [] + const listInnerBrackets: ParsedLineType[] = [] + const openBracketStack: number[] = [] + let temp: ParsedLineType | undefined + for (let i = 0; i < stack.length; i++) { + if (stack[i] === '(') { + openBracketStack.push(i) + temp = [] + listInnerBrackets.push(temp) + } else if (stack[i] === ')') { + const positionLastOpenBracket = openBracketStack.pop() + if (positionLastOpenBracket == null) { + throw new TypeError('Unexpected stack! Unexpected Bracket!') + } + const exprInBracket = listInnerBrackets.pop() + if (exprInBracket !== undefined) { + const valueInBracket = calcWithPriorities(exprInBracket) + if (listInnerBrackets.length === 0) { + result.push(valueInBracket) + } else { + const outerBracketExpr = listInnerBrackets[listInnerBrackets.length - 1] + if (outerBracketExpr !== undefined) { + outerBracketExpr.push(valueInBracket) + } + } + } + } else if (openBracketStack.length > 0) { + const outerBracketExpr = listInnerBrackets[listInnerBrackets.length - 1] + if (outerBracketExpr !== undefined) { + outerBracketExpr.push(stack[i]) + } + } else { + result.push(stack[i]) + } + } + return result +} + +export const calcWithPriorities = (bracketExprRes: ParsedLineType) => { + const firstPrioritiesRes = firstPrioritiesCalc(bracketExprRes) + + if (firstPrioritiesRes.length === 1) { + return Number(firstPrioritiesRes[0]) + } + + const secondPrioritiesRes = secondPrioritiesCalc(firstPrioritiesRes) + if (secondPrioritiesRes.length === 1) { + return Number(secondPrioritiesRes[0]) + } + return thirdPrioritiesCalc(secondPrioritiesRes) +} export const firstPrioritiesCalc = (stack: ParsedLineType): ParsedLineType => stack.reduce((result, nextItem) => { - const prevItem = result[result.length - 2]; - const item = result[result.length - 1]; + const prevItem = result[result.length - 2] + const item = result[result.length - 1] - if (!isNumber(String(item)) && mathOperatorsPriorities[item] === FIRST) { + if ((!isNumber(String(item)) && mathOperatorsPriorities[item] === FIRST) || + (isNumber(String(item)) && (mathOperatorsPriorities[nextItem] === FIRST) && + (nextItem === '**' || nextItem === '!'))) { + if (nextItem === '**' || nextItem === '!') { + result = [ + ...result.slice(0, -1), + mathOperators[nextItem](Number(item), Number(item)) + ] + } else { + result = [ + ...result.slice(0, -2), + mathOperators[item](Number(prevItem), Number(nextItem)) + ] + } + } else { + result.push(nextItem) + } + return result + }, []) + +export const secondPrioritiesCalc = (stack: ParsedLineType): ParsedLineType => + stack.reduce((result, nextItem) => { + const prevItem = result[result.length - 2] + const item = result[result.length - 1] + + if (!isNumber(String(item)) && mathOperatorsPriorities[item] === SECOND) { if (!mathOperators[item]) { - throw new TypeError("Unexpected stack!"); + throw new TypeError('Unexpected stack!') } result = [ ...result.slice(0, -2), - mathOperators[item](Number(prevItem), Number(nextItem)), - ]; + mathOperators[item](Number(prevItem), Number(nextItem)) + ] } else { - result.push(nextItem); + result.push(nextItem) } - return result; - }, []); + return result + }, []) -export const secondPrioritiesCalc = (stack: ParsedLineType): number => +export const thirdPrioritiesCalc = (stack: ParsedLineType): number => stack.reduce((result, nextItem, key) => { - const item = stack[key - 1]; + const item = stack[key - 1] - if (mathOperatorsPriorities[item] === FIRST) { - throw new TypeError("Unexpected stack!"); + if (mathOperatorsPriorities[item] === FIRST || mathOperatorsPriorities[item] === SECOND) { + throw new TypeError('Unexpected stack!') } - if (!isNumber(String(item)) && mathOperatorsPriorities[item] === SECOND) { - result = mathOperators[item](Number(result), Number(nextItem)); + if (!isNumber(String(item)) && mathOperatorsPriorities[item] === THIRD) { + result = mathOperators[item](Number(result), Number(nextItem)) } - return result; - }, Number(stack[0])); + return result + }, Number(stack[0])) diff --git a/src/lesson2/helpers.js b/src/lesson2/helpers.js new file mode 100644 index 0000000..5863f65 --- /dev/null +++ b/src/lesson2/helpers.js @@ -0,0 +1,5 @@ +'use strict' +Object.defineProperty(exports, '__esModule', { value: true }) +exports.isNumber = void 0 +exports.isNumber = function (item) { return !isNaN(Number(item)) } +// # sourceMappingURL=helpers.js.map diff --git a/src/lesson2/helpers.js.map b/src/lesson2/helpers.js.map new file mode 100644 index 0000000..e27f828 --- /dev/null +++ b/src/lesson2/helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.js","sourceRoot":"","sources":["helpers.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,UAAC,IAAY,IAAc,OAAA,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAApB,CAAoB,CAAC"} \ No newline at end of file diff --git a/src/lesson2/helpers.ts b/src/lesson2/helpers.ts index b5a4b6a..e24a8bc 100644 --- a/src/lesson2/helpers.ts +++ b/src/lesson2/helpers.ts @@ -1 +1 @@ -export const isNumber = (item: string): boolean => !isNaN(Number(item)); +export const isNumber = (item: string): boolean => !isNaN(Number(item)) diff --git a/src/lesson2/index.js b/src/lesson2/index.js new file mode 100644 index 0000000..4e0349d --- /dev/null +++ b/src/lesson2/index.js @@ -0,0 +1,74 @@ +'use strict' +const __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()) + }) +} +const __generator = (this && this.__generator) || function (thisArg, body) { + let _ = { label: 0, sent: function () { if (t[0] & 1) throw t[1]; return t[1] }, trys: [], ops: [] }; let f; let y; let t; let g + return g = { next: verb(0), throw: verb(1), return: verb(2) }, typeof Symbol === 'function' && (g[Symbol.iterator] = function () { return this }), g + function verb (n) { return function (v) { return step([n, v]) } } + function step (op) { + if (f) throw new TypeError('Generator is already executing.') + while (_) { + try { + if (f = 1, y && (t = op[0] & 2 ? y.return : op[0] ? y.throw || ((t = y.return) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t + if (y = 0, t) op = [op[0] & 2, t.value] + switch (op[0]) { + case 0: case 1: t = op; break + case 4: _.label++; return { value: op[1], done: false } + case 5: _.label++; y = op[1]; op = [0]; continue + case 7: op = _.ops.pop(); _.trys.pop(); continue + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break } + if (t[2]) _.ops.pop() + _.trys.pop(); continue + } + op = body.call(thisArg, _) + } catch (e) { op = [6, e]; y = 0 } finally { f = t = 0 } + } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true } + } +} +Object.defineProperty(exports, '__esModule', { value: true }) +const readline_1 = require('readline') +const runner_1 = require('./runner') +const rl = readline_1.createInterface({ + input: process.stdin, + output: process.stdout +}) +const question = function () { + return new Promise(function (resolve) { + rl.question('> ', function (answer) { + const result = runner_1.runner(answer) + if (result) { + console.log('Result: ' + result) + } + resolve() + }) + }) +} +function app () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!true) return [3 /* break */, 2] + return [4 /* yield */, question()] + case 1: + _a.sent() + return [3 /* break */, 0] + case 2: return [2] + } + }) + }) +} +app() +// # sourceMappingURL=index.js.map diff --git a/src/lesson2/index.js.map b/src/lesson2/index.js.map new file mode 100644 index 0000000..d61ecff --- /dev/null +++ b/src/lesson2/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAA2C;AAE3C,mCAAkC;AAElC,IAAM,EAAE,GAAG,0BAAe,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,MAAM,EAAE,OAAO,CAAC,MAAM;CACvB,CAAC,CAAC;AAEH,IAAM,QAAQ,GAAG;IACf,OAAA,IAAI,OAAO,CAAC,UAAC,OAAO;QAClB,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAC,MAAc;YAC/B,IAAM,MAAM,GAAG,eAAM,CAAC,MAAM,CAAC,CAAC;YAE9B,IAAI,MAAM,EAAE;gBACV,OAAO,CAAC,GAAG,CAAC,aAAW,MAAQ,CAAC,CAAC;aAClC;YAED,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AAVF,CAUE,CAAC;AAEL,SAAe,GAAG;;;;;yBACT,IAAI;oBACT,qBAAM,QAAQ,EAAE,EAAA;;oBAAhB,SAAgB,CAAC;;;;;;CAEpB;AAED,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/src/lesson2/index.ts b/src/lesson2/index.ts index 1766cf8..601817e 100644 --- a/src/lesson2/index.ts +++ b/src/lesson2/index.ts @@ -1,29 +1,29 @@ -import { createInterface } from "readline"; +import { createInterface } from 'readline' -import { runner } from "./runner"; +import { runner } from './runner' const rl = createInterface({ input: process.stdin, - output: process.stdout, -}); + output: process.stdout +}) const question = (): Promise => new Promise((resolve) => { - rl.question("> ", (answer: string) => { - const result = runner(answer); + rl.question('> ', (answer: string) => { + const result = runner(answer) if (result) { - console.log(`Result: ${result}`); + console.log(`Result: ${result}`) } - resolve(); - }); - }); + resolve() + }) + }) -async function app(): Promise { +async function app (): Promise { while (true) { - await question(); + await question() } } -app(); +app() diff --git a/src/lesson2/mathOperators.js b/src/lesson2/mathOperators.js new file mode 100644 index 0000000..f9d5475 --- /dev/null +++ b/src/lesson2/mathOperators.js @@ -0,0 +1,37 @@ +'use strict' +Object.defineProperty(exports, '__esModule', { value: true }) +exports.mathOperatorsPriorities = exports.mathPriorities = exports.mathOperators = exports.fac = exports.pow = exports.squar = exports.minus = exports.add = exports.div = exports.mul = void 0 +exports.mul = function (first, second) { return first * second } +exports.div = function (first, second) { return first / second } +exports.add = function (first, second) { return first + second } +exports.minus = function (first, second) { return first - second } +exports.squar = function (first) { return first * first } +exports.pow = function (first, second) { return Math.pow(first, second) } +exports.fac = function (first) { + let factor = 1 + for (let i = 1; i <= first; i++) { + factor = factor * i + } + return factor +} +exports.mathOperators = { + '*': exports.mul, + '/': exports.div, + '+': exports.add, + '-': exports.minus, + '**': exports.squar, + '^': exports.pow, + '!': exports.fac +} +exports.mathPriorities = [1, 2, 3] +const FIRST = exports.mathPriorities[0]; const SECOND = exports.mathPriorities[1]; const THIRD = exports.mathPriorities[2] +exports.mathOperatorsPriorities = { + '**': FIRST, + '^': FIRST, + '!': FIRST, + '*': SECOND, + '/': SECOND, + '+': THIRD, + '-': THIRD +} +// # sourceMappingURL=mathOperators.js.map diff --git a/src/lesson2/mathOperators.js.map b/src/lesson2/mathOperators.js.map new file mode 100644 index 0000000..a8f656b --- /dev/null +++ b/src/lesson2/mathOperators.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mathOperators.js","sourceRoot":"","sources":["mathOperators.ts"],"names":[],"mappings":";;;AAEa,QAAA,GAAG,GAAwB,UACtC,KAAa,EACb,MAAc,IACH,OAAA,KAAK,GAAG,MAAM,EAAd,CAAc,CAAC;AAEf,QAAA,GAAG,GAAwB,UACtC,KAAa,EACb,MAAc,IACH,OAAA,KAAK,GAAG,MAAM,EAAd,CAAc,CAAC;AAEf,QAAA,GAAG,GAAwB,UACtC,KAAa,EACb,MAAc,IACH,OAAA,KAAK,GAAG,MAAM,EAAd,CAAc,CAAC;AAEf,QAAA,KAAK,GAAwB,UACxC,KAAa,EACb,MAAc,IACH,OAAA,KAAK,GAAG,MAAM,EAAd,CAAc,CAAC;AAEf,QAAA,KAAK,GAAG,UACjB,KAAa,IACJ,OAAA,KAAK,GAAG,KAAK,EAAb,CAAa,CAAC;AAEd,QAAA,GAAG,GAAwB,UACpC,KAAa,EACb,MAAc,IACL,OAAA,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,EAAvB,CAAuB,CAAA;AAEvB,QAAA,GAAG,GAAG,UAAU,KAAa;IACxC,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,EAAE,EAAE;QAC/B,MAAM,GAAG,MAAM,GAAG,CAAC,CAAA;KACpB;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAA;AAEY,QAAA,aAAa,GAA2C;IACnE,GAAG,EAAE,WAAG;IACR,GAAG,EAAE,WAAG;IACR,GAAG,EAAE,WAAG;IACR,GAAG,EAAE,aAAK;IACV,IAAI,EAAE,aAAK;IACX,GAAG,EAAE,WAAG;IACR,GAAG,EAAE,WAAG;CACT,CAAC;AAGW,QAAA,cAAc,GAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAE3C,IAAA,KAAK,GAAmB,sBAAc,GAAjC,EAAE,MAAM,GAAW,sBAAc,GAAzB,EAAE,KAAK,GAAI,sBAAc,GAAlB,CAAmB;AAEjC,QAAA,uBAAuB,GAA8B;IAChE,IAAI,EAAE,KAAK;IACX,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;CACX,CAAC"} \ No newline at end of file diff --git a/src/lesson2/mathOperators.test.js b/src/lesson2/mathOperators.test.js new file mode 100644 index 0000000..d064479 --- /dev/null +++ b/src/lesson2/mathOperators.test.js @@ -0,0 +1,45 @@ +'use strict' +Object.defineProperty(exports, '__esModule', { value: true }) +const mathOperators_1 = require('./mathOperators') +describe('mathOperators test cases', function () { + it('mul 1 * 2 to equal 2', function () { + expect(mathOperators_1.mul(1, 2)).toBe(2) + }) + it('mul 2 * 2 to equal 4', function () { + expect(mathOperators_1.mul(2, 2)).toBe(4) + }) + it('div 2 / 2 to equal 1', function () { + expect(mathOperators_1.div(2, 2)).toBe(1) + }) + it('div 4 / 2 to equal 2', function () { + expect(mathOperators_1.div(4, 2)).toBe(2) + }) + it('add 4 + 2 to equal 6', function () { + expect(mathOperators_1.add(4, 2)).toBe(6) + }) + it('minus 4 - 2 to equal 2', function () { + expect(mathOperators_1.minus(4, 2)).toBe(2) + }) + it('squar 1 to equal 1', function () { + expect(mathOperators_1.squar(1)).toBe(1) + }) + it('squar 5 to equal 25', function () { + expect(mathOperators_1.squar(5)).toBe(25) + }) + it('2 to the power of 3 to equal 8', function () { + expect(mathOperators_1.pow(2, 3)).toBe(8) + }) + it('100 to the power of 3 to equal 1000000', function () { + expect(mathOperators_1.pow(100, 3)).toBe(1000000) + }) + it('factor of 0 to equal 1', function () { + expect(mathOperators_1.fac(0)).toBe(1) + }) + it('factor of 1 to equal 1', function () { + expect(mathOperators_1.fac(1)).toBe(1) + }) + it('factor of 5 to equal 120', function () { + expect(mathOperators_1.fac(5)).toBe(120) + }) +}) +// # sourceMappingURL=mathOperators.test.js.map diff --git a/src/lesson2/mathOperators.test.js.map b/src/lesson2/mathOperators.test.js.map new file mode 100644 index 0000000..ef9f868 --- /dev/null +++ b/src/lesson2/mathOperators.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mathOperators.test.js","sourceRoot":"","sources":["mathOperators.test.ts"],"names":[],"mappings":";;AAAA,iDAAsE;AAEtE,QAAQ,CAAC,0BAA0B,EAAE;IACnC,EAAE,CAAC,sBAAsB,EAAE;QACzB,MAAM,CAAC,mBAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE;QACzB,MAAM,CAAC,mBAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE;QACzB,MAAM,CAAC,mBAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE;QACzB,MAAM,CAAC,mBAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE;QACzB,MAAM,CAAC,mBAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE;QAC3B,MAAM,CAAC,qBAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qBAAqB,EAAE;QACxB,MAAM,CAAC,qBAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE;QACzB,MAAM,CAAC,qBAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE;QACpC,MAAM,CAAC,mBAAG,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE;QAC5C,MAAM,CAAC,mBAAG,CAAC,GAAG,EAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE;QAC3B,MAAM,CAAC,mBAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE;QAC3B,MAAM,CAAC,mBAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE;QAC7B,MAAM,CAAC,mBAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AAGL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/src/lesson2/mathOperators.test.ts b/src/lesson2/mathOperators.test.ts index aad07e8..ff73294 100644 --- a/src/lesson2/mathOperators.test.ts +++ b/src/lesson2/mathOperators.test.ts @@ -1,27 +1,55 @@ -import { mul, div, add, minus } from "./mathOperators"; +import { mul, div, add, minus, squar, pow, fac } from './mathOperators' -describe("mathOperators test cases", () => { - it("mul 1 * 2 to equal 2", () => { - expect(mul(1, 2)).toBe(2); - }); +describe('mathOperators test cases', () => { + it('mul 1 * 2 to equal 2', () => { + expect(mul(1, 2)).toBe(2) + }) - it("mul 2 * 2 to equal 4", () => { - expect(mul(2, 2)).toBe(4); - }); + it('mul 2 * 2 to equal 4', () => { + expect(mul(2, 2)).toBe(4) + }) - it("div 2 / 2 to equal 1", () => { - expect(div(2, 2)).toBe(1); - }); + it('div 2 / 2 to equal 1', () => { + expect(div(2, 2)).toBe(1) + }) - it("div 4 / 2 to equal 2", () => { - expect(div(4, 2)).toBe(2); - }); + it('div 4 / 2 to equal 2', () => { + expect(div(4, 2)).toBe(2) + }) - it("add 4 + 2 to equal 6", () => { - expect(add(4, 2)).toBe(6); - }); + it('add 4 + 2 to equal 6', () => { + expect(add(4, 2)).toBe(6) + }) - it("minus 4 - 2 to equal 2", () => { - expect(minus(4, 2)).toBe(2); - }); -}); + it('minus 4 - 2 to equal 2', () => { + expect(minus(4, 2)).toBe(2) + }) + + it('squar 1 to equal 1', () => { + expect(squar(1)).toBe(1) + }) + + it('squar 5 to equal 25', () => { + expect(squar(5)).toBe(25) + }) + + it('2 to the power of 3 to equal 8', () => { + expect(pow(2, 3)).toBe(8) + }) + + it('100 to the power of 3 to equal 1000000', () => { + expect(pow(100, 3)).toBe(1000000) + }) + + it('factor of 0 to equal 1', () => { + expect(fac(0)).toBe(1) + }) + + it('factor of 1 to equal 1', () => { + expect(fac(1)).toBe(1) + }) + + it('factor of 5 to equal 120', () => { + expect(fac(5)).toBe(120) + }) +}) diff --git a/src/lesson2/mathOperators.ts b/src/lesson2/mathOperators.ts index af8eb77..dd608d7 100644 --- a/src/lesson2/mathOperators.ts +++ b/src/lesson2/mathOperators.ts @@ -3,37 +3,58 @@ export type ScalarOperationType = (first: number, second: number) => number; export const mul: ScalarOperationType = ( first: number, second: number -): number => first * second; +): number => first * second export const div: ScalarOperationType = ( first: number, second: number -): number => first / second; +): number => first / second export const add: ScalarOperationType = ( first: number, second: number -): number => first + second; +): number => first + second export const minus: ScalarOperationType = ( first: number, second: number -): number => first - second; +): number => first - second + +export const squar = (first: number): number => first * first + +export const pow: ScalarOperationType = ( + first: number, + second: number +): number => Math.pow(first, second) + +export const fac = function (first: number): number { + let factor = 1 + for (let i = 1; i <= first; i++) { + factor = factor * i + } + return factor +} export const mathOperators: { [key: string]: ScalarOperationType } = { - "*": mul, - "/": div, - "+": add, - "-": minus, -}; + '*': mul, + '/': div, + '+': add, + '-': minus, + '**': squar, + '^': pow, + '!': fac +} -export const mathPriorities: number[] = [1, 2]; +export const mathPriorities: number[] = [1, 2, 3] -const [FIRST, SECOND] = mathPriorities; +const [FIRST, SECOND, THIRD] = mathPriorities export const mathOperatorsPriorities: { [key: string]: number } = { - "*": FIRST, - "/": FIRST, - "+": SECOND, - "-": SECOND, -}; + '**': FIRST, + '^': FIRST, + '!': FIRST, + '*': SECOND, + '/': SECOND, + '+': THIRD, + '-': THIRD +} diff --git a/src/lesson2/parser.js b/src/lesson2/parser.js new file mode 100644 index 0000000..e905fb2 --- /dev/null +++ b/src/lesson2/parser.js @@ -0,0 +1,72 @@ +'use strict' +Object.defineProperty(exports, '__esModule', { value: true }) +exports.parser = void 0 +const helpers_1 = require('./helpers') +const mathOperators_1 = require('./mathOperators') +const isSpace = function (str) { + return str.trim() == '' +} +exports.parser = function (line) { + let temp + const stack = [] + function isNum (char) { + return helpers_1.isNumber(char) || char === '.' || char === ',' + } + for (let i = 0; i < line.length; i++) { + if (isSpace(line[i])) { + if (temp) { + stack.push(temp) + temp = undefined + } + } else if (!isNum(line[i])) { + if (temp && isNum(temp)) { + stack.push(temp) + temp = line[i] + } else { + if (temp) { + if (temp === '*' && (line[i] === '*')) { + temp = '**' + } else { + stack.push(temp) + temp = line[i] + } + } else { + temp = line[i] + } + } + } else if (isNum(line[i])) { + if (temp) { + if (isNum(temp)) { + temp = '' + temp + line[i] + } else { + stack.push(temp) + temp = line[i] + } + } else { + temp = line[i] + } + } + } + if (temp) { + stack.push(temp) + } + // console.log("Result: "+ stack); + // const stack = line.split(" "); + return stack.reduce(function (result, item, key) { + const prevItem = stack[key - 1] + const isValidNumberPush = !helpers_1.isNumber(prevItem) && helpers_1.isNumber(item) && prevItem !== '!' + const isValidOperatorPush = (helpers_1.isNumber(prevItem) && !helpers_1.isNumber(item) && mathOperators_1.mathOperators.hasOwnProperty(item)) || + ((prevItem === '**' || prevItem === '!' || prevItem === ')') && !helpers_1.isNumber(item) && + mathOperators_1.mathOperators.hasOwnProperty(item)) || + (item === '(' || item === ')') + if (isValidNumberPush) { + result.push(Number(item)) + } else if (isValidOperatorPush) { + result.push(item) + } else { + throw new TypeError('Unexpected string') + } + return result + }, []) +} +// # sourceMappingURL=parser.js.map diff --git a/src/lesson2/parser.js.map b/src/lesson2/parser.js.map new file mode 100644 index 0000000..4a63d01 --- /dev/null +++ b/src/lesson2/parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.js","sourceRoot":"","sources":["parser.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/src/lesson2/parser.test.js b/src/lesson2/parser.test.js new file mode 100644 index 0000000..49dd576 --- /dev/null +++ b/src/lesson2/parser.test.js @@ -0,0 +1,37 @@ +'use strict' +Object.defineProperty(exports, '__esModule', { value: true }) +const parser_1 = require('./parser') +describe('Parser correct cases', function () { + it('1 + 32', function () { + expect(parser_1.parser('1 + 32')).toEqual([1, '+', 32]) + }) + it('11 + 3 * 22', function () { + expect(parser_1.parser('11 + 3 * 22')).toEqual([11, '+', 3, '*', 22]) + }) + it('1 + 32 - 2 + 2', function () { + expect(parser_1.parser('1 + 32 - 2 + 2')).toEqual([1, '+', 32, '-', 2, '+', 2]) + }) +}) +describe('Parser invalid cases', function () { + it('1 + + 33 - 2', function () { + expect(function () { return parser_1.parser('1 + + 33 - 2') }).toThrow(TypeError('Unexpected string')) + }) + it('1 ! 33 - 2', function () { + expect(function () { return parser_1.parser('1 ! 33 - 2') }).toThrow(TypeError('Unexpected string')) + }) +}) +describe('Parser correct cases without space', function () { + it('1+32', function () { + expect(parser_1.parser('1 + 32')).toEqual([1, '+', 32]) + }) + it('11+3*22', function () { + expect(parser_1.parser('11 + 3 * 22')).toEqual([11, '+', 3, '*', 22]) + }) + it('1+32-2 + 2', function () { + expect(parser_1.parser('1 + 32 - 2 + 2')).toEqual([1, '+', 32, '-', 2, '+', 2]) + }) + it('1 +32-2 + 2', function () { + expect(parser_1.parser('1 + 32 - 2 + 2')).toEqual([1, '+', 32, '-', 2, '+', 2]) + }) +}) +// # sourceMappingURL=parser.test.js.map diff --git a/src/lesson2/parser.test.js.map b/src/lesson2/parser.test.js.map new file mode 100644 index 0000000..8515244 --- /dev/null +++ b/src/lesson2/parser.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.test.js","sourceRoot":"","sources":["parser.test.ts"],"names":[],"mappings":";;AAAA,mCAAkC;AAElC,QAAQ,CAAC,sBAAsB,EAAE;IAC/B,EAAE,CAAC,QAAQ,EAAE;QACX,MAAM,CAAC,eAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,aAAa,EAAE;QAChB,MAAM,CAAC,eAAM,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gBAAgB,EAAE;QACnB,MAAM,CAAC,eAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,sBAAsB,EAAE;IAC/B,EAAE,CAAC,cAAc,EAAE;QACjB,MAAM,CAAC,cAAM,OAAA,eAAM,CAAC,cAAc,CAAC,EAAtB,CAAsB,CAAC,CAAC,OAAO,CAC1C,SAAS,CAAC,mBAAmB,CAAC,CAC/B,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,YAAY,EAAE;QACf,MAAM,CAAC,cAAM,OAAA,eAAM,CAAC,YAAY,CAAC,EAApB,CAAoB,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAGH,QAAQ,CAAC,oCAAoC,EAAE;IAC7C,EAAE,CAAC,MAAM,EAAE;QACT,MAAM,CAAC,eAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,SAAS,EAAE;QACZ,MAAM,CAAC,eAAM,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,YAAY,EAAE;QACf,MAAM,CAAC,eAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,cAAc,EAAE;QACjB,MAAM,CAAC,eAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/src/lesson2/parser.test.ts b/src/lesson2/parser.test.ts index 5593e31..e25f56e 100644 --- a/src/lesson2/parser.test.ts +++ b/src/lesson2/parser.test.ts @@ -1,27 +1,45 @@ -import { parser } from "./parser"; - -describe("Parser correct cases", () => { - it("1 + 32", () => { - expect(parser("1 + 32")).toEqual([1, "+", 32]); - }); - - it("11 + 3 * 22", () => { - expect(parser("11 + 3 * 22")).toEqual([11, "+", 3, "*", 22]); - }); - - it("1 + 32 - 2 + 2", () => { - expect(parser("1 + 32 - 2 + 2")).toEqual([1, "+", 32, "-", 2, "+", 2]); - }); -}); - -describe("Parser invalid cases", () => { - it("1 + + 33 - 2", () => { - expect(() => parser("1 + + 33 - 2")).toThrow( - TypeError("Unexpected string") - ); - }); - - it("1 ! 33 - 2", () => { - expect(() => parser("1 ! 33 - 2")).toThrow(TypeError("Unexpected string")); - }); -}); +import { parser } from './parser' + +describe('Parser correct cases', () => { + it('1 + 32', () => { + expect(parser('1 + 32')).toEqual([1, '+', 32]) + }) + + it('11 + 3 * 22', () => { + expect(parser('11 + 3 * 22')).toEqual([11, '+', 3, '*', 22]) + }) + + it('1 + 32 - 2 + 2', () => { + expect(parser('1 + 32 - 2 + 2')).toEqual([1, '+', 32, '-', 2, '+', 2]) + }) +}) + +describe('Parser invalid cases', () => { + it('1 + + 33 - 2', () => { + expect(() => parser('1 + + 33 - 2')).toThrow( + TypeError('Unexpected string') + ) + }) + + it('1 ! 33 - 2', () => { + expect(() => parser('1 ! 33 - 2')).toThrow(TypeError('Unexpected string')) + }) +}) + +describe('Parser correct cases without space', () => { + it('1+32', () => { + expect(parser('1 + 32')).toEqual([1, '+', 32]) + }) + + it('11+3*22', () => { + expect(parser('11 + 3 * 22')).toEqual([11, '+', 3, '*', 22]) + }) + + it('1+32-2 + 2', () => { + expect(parser('1 + 32 - 2 + 2')).toEqual([1, '+', 32, '-', 2, '+', 2]) + }) + + it('1 +32-2 + 2', () => { + expect(parser('1 + 32 - 2 + 2')).toEqual([1, '+', 32, '-', 2, '+', 2]) + }) +}) diff --git a/src/lesson2/parser.ts b/src/lesson2/parser.ts index 118ff66..1a8b3e7 100644 --- a/src/lesson2/parser.ts +++ b/src/lesson2/parser.ts @@ -1,27 +1,82 @@ -import { isNumber } from "./helpers"; -import { mathOperators } from "./mathOperators"; +import { isNumber } from './helpers' +import { mathOperators } from './mathOperators' export type ParsedLineType = (number | string)[]; -export const parser = (line: string): ParsedLineType | null => { - const stack = line.split(" "); +const isSpace = (str: string) => str.trim() === '' + +export const parser = function (line: string) { + let temp: string | undefined + const stack: string[] = [] + + function isNum (char: string) { + return isNumber(char) || char === '.' || char === ',' + } + + for (let i = 0; i < line.length; i++) { + if (isSpace(line[i])) { + if (temp) { + stack.push(temp) + temp = undefined + } + } else if (!isNum(line[i])) { + if (temp && isNum(temp)) { + stack.push(temp) + temp = line[i] + } else { + if (temp) { + if (temp === '*' && line[i] === '*') { + temp = '**' + } else { + stack.push(temp) + temp = line[i] + } + } else { + temp = line[i] + } + } + } else if (isNum(line[i])) { + if (temp) { + if (isNum(temp)) { + temp = '' + temp + line[i] + } else { + stack.push(temp) + temp = line[i] + } + } else { + temp = line[i] + } + } + } + if (temp) { + stack.push(temp) + } + // console.log("Result: "+ stack); + + // const stack = line.split(" "); return stack.reduce((result, item, key) => { - const prevItem = stack[key - 1]; + const prevItem = stack[key - 1] - const isValidNumberPush = !isNumber(prevItem) && isNumber(item); + const isValidNumberPush = + !isNumber(prevItem) && isNumber(item) && prevItem !== '!' const isValidOperatorPush = - isNumber(prevItem) && - !isNumber(item) && - mathOperators.hasOwnProperty(item); + (isNumber(prevItem) && + !isNumber(item) && + mathOperators.hasOwnProperty(item)) || + ((prevItem === '**' || prevItem === '!' || prevItem === ')') && + !isNumber(item) && + mathOperators.hasOwnProperty(item)) || + item === '(' || + item === ')' if (isValidNumberPush) { - result.push(Number(item)); + result.push(Number(item)) } else if (isValidOperatorPush) { - result.push(item); + result.push(item) } else { - throw new TypeError("Unexpected string"); + throw new TypeError('Unexpected string') } - return result; - }, []); -}; + return result + }, []) +} diff --git a/src/lesson2/runner.js b/src/lesson2/runner.js new file mode 100644 index 0000000..5fed0f0 --- /dev/null +++ b/src/lesson2/runner.js @@ -0,0 +1,17 @@ +'use strict' +Object.defineProperty(exports, '__esModule', { value: true }) +exports.runner = void 0 +const parser_1 = require('./parser') +const engine_1 = require('./engine') +exports.runner = function (line) { + const stack = parser_1.parser(line) + if (stack === null) { + throw new TypeError('Unexpected string') + } + const bracketExprRes = engine_1.bracketExprCalc(stack) + if (bracketExprRes.length === 1) { + return Number(bracketExprRes[0]) + } + return engine_1.calcWithPriorities(bracketExprRes) +} +// # sourceMappingURL=runner.js.map diff --git a/src/lesson2/runner.js.map b/src/lesson2/runner.js.map new file mode 100644 index 0000000..6ec1a1a --- /dev/null +++ b/src/lesson2/runner.js.map @@ -0,0 +1 @@ +{"version":3,"file":"runner.js","sourceRoot":"","sources":["runner.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAElC,mCAGkB;AAEL,QAAA,MAAM,GAAG,UAAC,IAAY;IACjC,IAAM,KAAK,GAAG,eAAM,CAAC,IAAI,CAAC,CAAC;IAE3B,IAAI,KAAK,KAAK,IAAI,EAAE;QAClB,MAAM,IAAI,SAAS,CAAC,mBAAmB,CAAC,CAAC;KAC1C;IAID,IAAM,cAAc,GAAG,wBAAe,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;QAC/B,OAAO,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;KAClC;IAED,OAAO,2BAAkB,CAAC,cAAc,CAAC,CAAC;AAC5C,CAAC,CAAC"} \ No newline at end of file diff --git a/src/lesson2/runner.test.js b/src/lesson2/runner.test.js new file mode 100644 index 0000000..2f25bb9 --- /dev/null +++ b/src/lesson2/runner.test.js @@ -0,0 +1,69 @@ +'use strict' +Object.defineProperty(exports, '__esModule', { value: true }) +const runner_1 = require('./runner') +describe('Runner simple cases', function () { + it('1 * 32', function () { + expect(runner_1.runner('1 * 32')).toEqual(32) + }) + it('2 * 32', function () { + expect(runner_1.runner('2 * 32')).toEqual(64) + }) + it('2 + 32', function () { + expect(runner_1.runner('2 + 32')).toEqual(34) + }) +}) +describe('Runner tripled/mixed cases', function () { + it('2 * 2 * 3', function () { + expect(runner_1.runner('2 * 2 * 3')).toEqual(12) + }) + it('2 * 2 + 3', function () { + expect(runner_1.runner('2 * 2 + 3')).toEqual(7) + }) + it('2 + 2 * 3', function () { + expect(runner_1.runner('2 + 2 * 3')).toEqual(8) + }) +}) +describe('Runner long cases', function () { + it('20 + 1 * 10 - 5 * 3', function () { + expect(runner_1.runner('20 + 1 * 10 - 5 * 3')).toEqual(15) + }) + it('20 - 10 * 10 / 5 - 3', function () { + expect(runner_1.runner('20 - 10 * 10 / 5 - 3')).toEqual(-3) + }) +}) +describe('Runner cases with brackets', function () { + it('(20 + 1) * 10 - 5 * 3', function () { + expect(runner_1.runner('(20 + 1) * 10 - 5 * 3')).toEqual(195) + }) + it('(20 ) * 10 - 5 * 3', function () { + expect(runner_1.runner('(20 ) * 10 - 5 * 3')).toEqual(185) + }) + it('(20 + 1) * (10 - 5) * 3', function () { + expect(runner_1.runner('(20 + 1) * (10 - 5) * 3')).toEqual(315) + }) + it('((20 + 1) *2 - (10 - 5)) * 3', function () { + expect(runner_1.runner('((20 + 1) *2 - (10 - 5)) * 3')).toEqual(111) + }) +}) +describe('Runner cases with power and brackets', function () { + it('(20 ^ 2) ** 2 - 5 * 3^2', function () { + expect(runner_1.runner('(20 ^ 2) ^ 2 - 5 * 3^2')).toEqual(159955) + }) + it('(20 **) ^ 3 - 5 * 3^9', function () { + expect(runner_1.runner('(20 ^ 2) ^ 3 - 5 * 3^9')).toEqual(63901585) + }) +}) +describe('Runner cases with factorial', function () { + it('4!', function () { + expect(runner_1.runner('4!')).toEqual(24) + }) + it('(3! + 3!)!', function () { + expect(runner_1.runner('(3! + 3!)!')).toEqual(479001600) + }) +}) +describe('Runner full operations', function () { + it('(((20 - 6!)**)/2+45^3)*12- (2^3)! ', function () { + expect(runner_1.runner('(((20 - 6!)**)/2+45^3)*12- (2^3)! ')).toEqual(3993180) + }) +}) +// # sourceMappingURL=runner.test.js.map diff --git a/src/lesson2/runner.test.js.map b/src/lesson2/runner.test.js.map new file mode 100644 index 0000000..d83373c --- /dev/null +++ b/src/lesson2/runner.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"runner.test.js","sourceRoot":"","sources":["runner.test.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/src/lesson2/runner.test.ts b/src/lesson2/runner.test.ts index 1318dce..716a4e2 100644 --- a/src/lesson2/runner.test.ts +++ b/src/lesson2/runner.test.ts @@ -1,39 +1,83 @@ -import { runner } from "./runner"; - -describe("Runner simple cases", () => { - it("1 * 32", () => { - expect(runner("1 * 32")).toEqual(32); - }); - - it("2 * 32", () => { - expect(runner("2 * 32")).toEqual(64); - }); - - it("2 + 32", () => { - expect(runner("2 + 32")).toEqual(34); - }); -}); - -describe("Runner tripled/mixed cases", () => { - it("2 * 2 * 3", () => { - expect(runner("2 * 2 * 3")).toEqual(12); - }); - - it("2 * 2 + 3", () => { - expect(runner("2 * 2 + 3")).toEqual(7); - }); - - it("2 + 2 * 3", () => { - expect(runner("2 + 2 * 3")).toEqual(8); - }); -}); - -describe("Runner long cases", () => { - it("20 + 1 * 10 - 5 * 3", () => { - expect(runner("20 + 1 * 10 - 5 * 3")).toEqual(15); - }); - - it("20 - 10 * 10 / 5 - 3", () => { - expect(runner("20 - 10 * 10 / 5 - 3")).toEqual(-3); - }); -}); +import { runner } from './runner' + +describe('Runner simple cases', () => { + it('1 * 32', () => { + expect(runner('1 * 32')).toEqual(32) + }) + + it('2 * 32', () => { + expect(runner('2 * 32')).toEqual(64) + }) + + it('2 + 32', () => { + expect(runner('2 + 32')).toEqual(34) + }) +}) + +describe('Runner tripled/mixed cases', () => { + it('2 * 2 * 3', () => { + expect(runner('2 * 2 * 3')).toEqual(12) + }) + + it('2 * 2 + 3', () => { + expect(runner('2 * 2 + 3')).toEqual(7) + }) + + it('2 + 2 * 3', () => { + expect(runner('2 + 2 * 3')).toEqual(8) + }) +}) + +describe('Runner long cases', () => { + it('20 + 1 * 10 - 5 * 3', () => { + expect(runner('20 + 1 * 10 - 5 * 3')).toEqual(15) + }) + + it('20 - 10 * 10 / 5 - 3', () => { + expect(runner('20 - 10 * 10 / 5 - 3')).toEqual(-3) + }) +}) + +describe('Runner cases with brackets', () => { + it('(20 + 1) * 10 - 5 * 3', () => { + expect(runner('(20 + 1) * 10 - 5 * 3')).toEqual(195) + }) + + it('(20 ) * 10 - 5 * 3', () => { + expect(runner('(20 ) * 10 - 5 * 3')).toEqual(185) + }) + + it('(20 + 1) * (10 - 5) * 3', () => { + expect(runner('(20 + 1) * (10 - 5) * 3')).toEqual(315) + }) + + it('((20 + 1) *2 - (10 - 5)) * 3', () => { + expect(runner('((20 + 1) *2 - (10 - 5)) * 3')).toEqual(111) + }) +}) + +describe('Runner cases with power and brackets', () => { + it('(20 ^ 2) ** 2 - 5 * 3^2', () => { + expect(runner('(20 ^ 2) ^ 2 - 5 * 3^2')).toEqual(159955) + }) + + it('(20 **) ^ 3 - 5 * 3^9', () => { + expect(runner('(20 ^ 2) ^ 3 - 5 * 3^9')).toEqual(63901585) + }) +}) + +describe('Runner cases with factorial', () => { + it('4!', () => { + expect(runner('4!')).toEqual(24) + }) + + it('(3! + 3!)!', () => { + expect(runner('(3! + 3!)!')).toEqual(479001600) + }) +}) + +describe('Runner full operations', () => { + it('(((20 - 6!)**)/2+45^3)*12- (2^3)! ', () => { + expect(runner('(((20 - 6!)**)/2+45^3)*12- (2^3)! ')).toEqual(3993180) + }) +}) diff --git a/src/lesson2/runner.ts b/src/lesson2/runner.ts index 920249f..f24e8bd 100644 --- a/src/lesson2/runner.ts +++ b/src/lesson2/runner.ts @@ -1,19 +1,18 @@ -import { parser } from "./parser"; +import { parser } from './parser' -import { firstPrioritiesCalc, secondPrioritiesCalc } from "./engine"; +import { bracketExprCalc, calcWithPriorities } from './engine' export const runner = (line: string): number => { - const stack = parser(line); + const stack = parser(line) if (stack === null) { - throw new TypeError("Unexpected string"); + throw new TypeError('Unexpected string') } - const firstPrioritiesRes = firstPrioritiesCalc(stack); - - if (firstPrioritiesRes.length === 1) { - return Number(firstPrioritiesRes[0]); + const bracketExprRes = bracketExprCalc(stack) + if (bracketExprRes.length === 1) { + return Number(bracketExprRes[0]) } - return secondPrioritiesCalc(firstPrioritiesRes); -}; + return calcWithPriorities(bracketExprRes) +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..cc1bb67 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "allowJs": true, + "jsx": "react", + "sourceMap": true, + "strict": true, + "esModuleInterop": true + } +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..9c67113 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,15 @@ +const path = require('path') + +module.exports = { + entry: 'src/lesson2/index.js', + module: { + rules: [ + { test: /\.svg$/, use: 'svg-inline-loader' }, + { test: /\.css$/, use: ['style-loader', 'css-loader'] } + ] + }, + output: { + path: path.resolve(__dirname, 'dist'), + filename: 'index_bundle.js' + } +} From c56b091631c8d1270516efaead21580da01e57f4 Mon Sep 17 00:00:00 2001 From: "Vladimir.Sushchen" Date: Wed, 20 Oct 2021 13:46:41 +0300 Subject: [PATCH 2/8] come changes --- package.json | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 414ba73..0e73784 100644 --- a/package.json +++ b/package.json @@ -1,31 +1,19 @@ { - "name": "react-js-tutorial", + "name": "react-otus-homework", "version": "1.0.0", "description": "", "main": "lesson2/index.js", "scripts": { "build": "npx webpack --mode production", "calc": "npx ts-node src/lesson2", - "lint": "npx eslint --ext .js,.jsx,.ts,.tsx --fix ./", - "test": "npx jest", - "check": "npm test && npm run lint" - }, - "husky": { - "hooks": { - "pre-commit": "npm run check", - "pre-push": "npm run check" - } + "test": "npx jest" }, "repository": { "type": "git", - "url": "git+https://github.com/nickovchinnikov/react-js-tutorial.git" + "url": "https://github.com/Vladimir2308/react-otus-homework.git" }, - "author": "Nick Ovchinnikov", + "author": "Vladimir Sushchen", "license": "ISC", - "bugs": { - "url": "https://github.com/nickovchinnikov/react-js-tutorial/issues" - }, - "homepage": "https://github.com/nickovchinnikov/react-js-tutorial#readme", "devDependencies": { "@babel/core": "^7.9.0", "@babel/preset-env": "^7.9.0", @@ -44,7 +32,6 @@ "eslint-plugin-promise": "^5.1.0", "eslint-plugin-react": "^7.26.1", "html-webpack-plugin": "^4.0.3", - "husky": "^4.2.3", "jest": "^25.2.4", "prettier": "^2.0.2", "ts-node": "^8.8.2", From 6e8b5a66e976ae879b1c64645dfe9d8e6cd2a330 Mon Sep 17 00:00:00 2001 From: "Vladimir.Sushchen" Date: Wed, 20 Oct 2021 14:01:04 +0300 Subject: [PATCH 3/8] del comments --- src/lesson2/parser.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/lesson2/parser.ts b/src/lesson2/parser.ts index 1a8b3e7..265ac87 100644 --- a/src/lesson2/parser.ts +++ b/src/lesson2/parser.ts @@ -51,9 +51,6 @@ export const parser = function (line: string) { if (temp) { stack.push(temp) } - // console.log("Result: "+ stack); - - // const stack = line.split(" "); return stack.reduce((result, item, key) => { const prevItem = stack[key - 1] From 61f7d3d8092c4bb9a0c370dfbb1208cd538d42dc Mon Sep 17 00:00:00 2001 From: "Vladimir.Sushchen" Date: Thu, 21 Oct 2021 15:39:15 +0300 Subject: [PATCH 4/8] change config files --- package-lock.json | 196 +--------------------------------------------- package.json | 5 +- src/index.tsx | 0 tsconfig.json | 11 ++- 4 files changed, 11 insertions(+), 201 deletions(-) delete mode 100644 src/index.tsx diff --git a/package-lock.json b/package-lock.json index 4283397..d2f3e1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "react-js-tutorial", + "name": "react-otus-homework", "version": "1.0.0", "lockfileVersion": 1, "requires": true, @@ -1850,12 +1850,6 @@ "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, - "@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, "@types/prettier": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-1.19.1.tgz", @@ -3463,12 +3457,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "compare-versions": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true - }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -3637,19 +3625,6 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, - "cosmiconfig": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", - "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", - "dev": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - } - }, "create-ecdh": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", @@ -5465,15 +5440,6 @@ "path-exists": "^4.0.0" } }, - "find-versions": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", - "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", - "dev": true, - "requires": { - "semver-regex": "^3.1.2" - } - }, "findup-sync": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", @@ -6355,121 +6321,6 @@ "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", "dev": true }, - "husky": { - "version": "4.3.8", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz", - "integrity": "sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "ci-info": "^2.0.0", - "compare-versions": "^3.6.0", - "cosmiconfig": "^7.0.0", - "find-versions": "^4.0.0", - "opencollective-postinstall": "^2.0.2", - "pkg-dir": "^5.0.0", - "please-upgrade-node": "^3.2.0", - "slash": "^3.0.0", - "which-pm-runs": "^1.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "pkg-dir": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", - "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", - "dev": true, - "requires": { - "find-up": "^5.0.0" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -9188,12 +9039,6 @@ "mimic-fn": "^2.1.0" } }, - "opencollective-postinstall": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", - "dev": true - }, "opn": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", @@ -9526,15 +9371,6 @@ "find-up": "^4.0.0" } }, - "please-upgrade-node": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", - "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", - "dev": true, - "requires": { - "semver-compare": "^1.0.0" - } - }, "pn": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", @@ -10470,18 +10306,6 @@ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, - "semver-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", - "dev": true - }, - "semver-regex": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.3.tgz", - "integrity": "sha512-Aqi54Mk9uYTjVexLnR67rTyBusmwd04cLkHy9hNvk3+G3nT2Oyg7E0l4XVbOaNwIvQ3hHeYxGcyEy+mKreyBFQ==", - "dev": true - }, "send": { "version": "0.17.1", "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", @@ -13271,12 +13095,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "which-pm-runs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", - "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", - "dev": true - }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -13392,12 +13210,6 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "dev": true - }, "yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", @@ -13432,12 +13244,6 @@ "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true } } } diff --git a/package.json b/package.json index 0e73784..ddc2bfb 100644 --- a/package.json +++ b/package.json @@ -35,12 +35,13 @@ "jest": "^25.2.4", "prettier": "^2.0.2", "ts-node": "^8.8.2", - "typescript": "^3.8.3", + "typescript": "^3.9.10", "webpack": "^4.46.0", "webpack-cli": "^3.3.12", "webpack-dev-server": "^3.10.3" }, "dependencies": { "core-js": "^3.18.3" - } + }, + "exclude": ["node_modules", "lib", "tests"] } diff --git a/src/index.tsx b/src/index.tsx deleted file mode 100644 index e69de29..0000000 diff --git a/tsconfig.json b/tsconfig.json index cc1bb67..a0c07b3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,14 @@ { "compilerOptions": { - "target": "es5", + "target": "es6", "module": "commonjs", - "allowJs": true, "jsx": "react", - "sourceMap": true, "strict": true, - "esModuleInterop": true + "esModuleInterop": true, + "outDir": "./dist", + "rootDirs": [ + ".", + "./src/lesson2" + ] } } From 9bc8007136bad623d4c43e25a22cf7a2b3e02009 Mon Sep 17 00:00:00 2001 From: "Vladimir.Sushchen" Date: Thu, 21 Oct 2021 17:04:10 +0300 Subject: [PATCH 5/8] repair run for script, repair build --- README.md | 13 +- package-lock.json | 1914 ++++++++------------------------------------- package.json | 23 +- webpack.config.js | 7 +- 4 files changed, 358 insertions(+), 1599 deletions(-) diff --git a/README.md b/README.md index 7b67276..68c3a55 100644 --- a/README.md +++ b/README.md @@ -15,4 +15,15 @@ https://github.com/nickovchinnikov/react-js-tutorial/pull/3 пример: (2 + 2) * 2 = 8 Добавлена обработка текста без пробелов, формулы можно вводить прямым текстом -Добавлены тесты \ No newline at end of file +Добавлены тесты + +Установка зависимостей: +>npm i +Запуск тестов +>npm t +Запуск программы +>npm run calc +Сборка +>npm run-script build + + diff --git a/package-lock.json b/package-lock.json index d2f3e1e..5f5ce22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1760,6 +1760,32 @@ "@babel/types": "^7.3.0" } }, + "@types/eslint": { + "version": "7.28.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.1.tgz", + "integrity": "sha512-XhZKznR3i/W5dXqUhgU9fFdJekufbeBd5DALmkuXoeFcjbQcPk+2cL+WLHf6Q81HWAnM2vrslIHpGVyCAviRwg==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g==", + "dev": true, + "requires": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "@types/estree": { + "version": "0.0.50", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", + "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==", + "dev": true + }, "@types/glob": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.4.tgz", @@ -2073,177 +2099,148 @@ } }, "@webassemblyjs/ast": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", - "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", + "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", "dev": true, "requires": { - "@webassemblyjs/helper-module-context": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/wast-parser": "1.9.0" + "@webassemblyjs/helper-numbers": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1" } }, "@webassemblyjs/floating-point-hex-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", - "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", + "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", "dev": true }, "@webassemblyjs/helper-api-error": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", - "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", + "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", "dev": true }, "@webassemblyjs/helper-buffer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", - "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", - "dev": true - }, - "@webassemblyjs/helper-code-frame": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", - "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", - "dev": true, - "requires": { - "@webassemblyjs/wast-printer": "1.9.0" - } - }, - "@webassemblyjs/helper-fsm": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", - "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", + "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", "dev": true }, - "@webassemblyjs/helper-module-context": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", - "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", + "@webassemblyjs/helper-numbers": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", + "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.9.0" + "@webassemblyjs/floating-point-hex-parser": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@xtuc/long": "4.2.2" } }, "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", - "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", + "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", "dev": true }, "@webassemblyjs/helper-wasm-section": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", - "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", + "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1" } }, "@webassemblyjs/ieee754": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", - "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", + "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", "dev": true, "requires": { "@xtuc/ieee754": "^1.2.0" } }, "@webassemblyjs/leb128": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", - "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", + "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", "dev": true, "requires": { "@xtuc/long": "4.2.2" } }, "@webassemblyjs/utf8": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", - "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", + "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", "dev": true }, "@webassemblyjs/wasm-edit": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", - "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", + "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/helper-wasm-section": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0", - "@webassemblyjs/wasm-opt": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0", - "@webassemblyjs/wast-printer": "1.9.0" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/helper-wasm-section": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-opt": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "@webassemblyjs/wast-printer": "1.11.1" } }, "@webassemblyjs/wasm-gen": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", - "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", + "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/ieee754": "1.9.0", - "@webassemblyjs/leb128": "1.9.0", - "@webassemblyjs/utf8": "1.9.0" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" } }, "@webassemblyjs/wasm-opt": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", - "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", + "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1" } }, "@webassemblyjs/wasm-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", - "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-api-error": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/ieee754": "1.9.0", - "@webassemblyjs/leb128": "1.9.0", - "@webassemblyjs/utf8": "1.9.0" - } - }, - "@webassemblyjs/wast-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", - "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", + "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/floating-point-hex-parser": "1.9.0", - "@webassemblyjs/helper-api-error": "1.9.0", - "@webassemblyjs/helper-code-frame": "1.9.0", - "@webassemblyjs/helper-fsm": "1.9.0", - "@xtuc/long": "4.2.2" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" } }, "@webassemblyjs/wast-printer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", - "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", + "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/wast-parser": "1.9.0", + "@webassemblyjs/ast": "1.11.1", "@xtuc/long": "4.2.2" } }, @@ -2299,6 +2296,12 @@ } } }, + "acorn-import-assertions": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", + "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "dev": true + }, "acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", @@ -2389,12 +2392,6 @@ "picomatch": "^2.0.4" } }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -2505,53 +2502,6 @@ "safer-buffer": "~2.1.0" } }, - "asn1.js": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, - "assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "requires": { - "object-assign": "^4.1.1", - "util": "0.10.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "requires": { - "inherits": "2.0.1" - } - } - } - }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", @@ -2603,6 +2553,12 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, + "available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true + }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -2847,12 +2803,6 @@ } } }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true - }, "batch": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", @@ -2874,25 +2824,6 @@ "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "optional": true - }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", - "dev": true - }, "body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", @@ -2979,12 +2910,6 @@ "fill-range": "^7.0.1" } }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, "browser-process-hrtime": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", @@ -3008,98 +2933,6 @@ } } }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", - "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", - "dev": true, - "requires": { - "bn.js": "^5.0.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", - "dev": true, - "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "~1.0.5" - } - }, "browserslist": { "version": "4.17.4", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.4.tgz", @@ -3122,17 +2955,6 @@ "node-int64": "^0.4.0" } }, - "buffer": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", - "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -3145,64 +2967,12 @@ "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==", "dev": true }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, "bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", "dev": true }, - "cacache": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", - "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", - "dev": true, - "requires": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "infer-owner": "^1.0.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.3", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - } - } - }, "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -3292,29 +3062,6 @@ "supports-color": "^5.3.0" } }, - "chokidar": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", - "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", - "dev": true, - "optional": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true - }, "chrome-trace-event": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", @@ -3327,16 +3074,6 @@ "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -3510,36 +3247,12 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, "connect-history-api-fallback": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", "dev": true }, - "console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", - "dev": true - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, "content-disposition": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", @@ -3576,20 +3289,6 @@ "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", "dev": true }, - "copy-concurrently": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", - "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" - } - }, "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", @@ -3599,7 +3298,8 @@ "core-js": { "version": "3.18.3", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.3.tgz", - "integrity": "sha512-tReEhtMReZaPFVw7dajMx0vlsz3oOb8ajgPoHVYGxr8ErnZ6PcYEvvmjGmXlfpnxpkYSdOQttjB+MvVbCGfvLw==" + "integrity": "sha512-tReEhtMReZaPFVw7dajMx0vlsz3oOb8ajgPoHVYGxr8ErnZ6PcYEvvmjGmXlfpnxpkYSdOQttjB+MvVbCGfvLw==", + "dev": true }, "core-js-compat": { "version": "3.18.3", @@ -3625,51 +3325,6 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, - "create-ecdh": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -3700,25 +3355,6 @@ } } }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, "css-select": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.1.3.tgz", @@ -3761,12 +3397,6 @@ } } }, - "cyclist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", - "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", - "dev": true - }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -3921,16 +3551,6 @@ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "dev": true }, - "des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, "destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", @@ -3967,25 +3587,6 @@ "integrity": "sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg==", "dev": true }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -4049,12 +3650,6 @@ "entities": "^2.0.0" } }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, "domelementtype": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", @@ -4108,18 +3703,6 @@ } } }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -4142,29 +3725,6 @@ "integrity": "sha512-qcLvDUPf8DSIMWarHT2ptgcqrYg62n3vPA7vhrOF24d8UNzbUBaHu2CySiENR3nEDzYgaN60071t0F6KLYMQ7Q==", "dev": true }, - "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dev": true, - "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -4284,6 +3844,12 @@ "unbox-primitive": "^1.0.1" } }, + "es-module-lexer": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", + "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", + "dev": true + }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -4998,16 +4564,6 @@ "original": "^1.0.0" } }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, "exec-sh": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.6.tgz", @@ -5363,12 +4919,6 @@ "bser": "2.1.1" } }, - "figgy-pudding": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", - "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", - "dev": true - }, "file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -5584,16 +5134,6 @@ "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", "dev": true }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - } - }, "follow-redirects": { "version": "1.14.4", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", @@ -5606,6 +5146,12 @@ "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -5644,27 +5190,11 @@ "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", "dev": true }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" - } + "fs": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", + "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=", + "dev": true }, "fs.realpath": { "version": "1.0.0", @@ -5783,6 +5313,12 @@ "is-glob": "^4.0.1" } }, + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, "global-modules": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", @@ -5988,63 +5524,12 @@ } } }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", @@ -6309,12 +5794,6 @@ "sshpk": "^1.7.0" } }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, "human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -6330,18 +5809,6 @@ "safer-buffer": ">= 2.1.2 < 3" } }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true - }, - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true - }, "ignore": { "version": "5.1.8", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", @@ -6382,12 +5849,6 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, - "infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "dev": true - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -6506,16 +5967,6 @@ "has-bigints": "^1.0.1" } }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "optional": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, "is-boolean-object": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", @@ -6635,6 +6086,15 @@ "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true }, + "is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -6738,6 +6198,19 @@ "has-symbols": "^1.0.2" } }, + "is-typed-array": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.8.tgz", + "integrity": "sha512-HqH41TNZq2fgtGT8WHVFVJhBVGuY3AnP3Q36K8JKXUxSxRgk/d+7NjmwG2vo2mYmXK8UYZKu0qH8bVP5gEisjA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-abstract": "^1.18.5", + "foreach": "^2.0.5", + "has-tostringtag": "^1.0.0" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -8273,9 +7746,9 @@ "dev": true }, "loader-runner": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", - "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", + "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", "dev": true }, "loader-utils": { @@ -8434,17 +7907,6 @@ "object-visit": "^1.0.0" } }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -8495,24 +7957,6 @@ "picomatch": "^2.2.3" } }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, "mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -8546,12 +7990,6 @@ "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", "dev": true }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -8567,24 +8005,6 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "mississippi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", - "dev": true, - "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - } - }, "mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", @@ -8615,20 +8035,6 @@ "minimist": "^1.2.5" } }, - "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -8724,45 +8130,6 @@ "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", "dev": true }, - "node-libs-browser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", - "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", - "dev": true, - "requires": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^3.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "0.0.1", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.11.0", - "vm-browserify": "^1.0.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } - } - }, "node-modules-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", @@ -9079,12 +8446,6 @@ "url-parse": "^1.4.3" } }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, "p-each-series": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", @@ -9136,23 +8497,6 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, - "pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, - "parallel-transform": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", - "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", - "dev": true, - "requires": { - "cyclist": "^1.0.1", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - } - }, "param-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", @@ -9180,19 +8524,6 @@ "callsites": "^3.0.0" } }, - "parse-asn1": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", - "dev": true, - "requires": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, "parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -9247,12 +8578,6 @@ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, - "path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", @@ -9301,19 +8626,6 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, - "pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -9474,12 +8786,6 @@ } } }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -9492,12 +8798,6 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, "prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", @@ -9541,28 +8841,6 @@ "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", "dev": true }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -9573,29 +8851,6 @@ "once": "^1.3.1" } }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - }, - "dependencies": { - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -9614,12 +8869,6 @@ "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", "dev": true }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, "querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", @@ -9641,16 +8890,6 @@ "safe-buffer": "^5.1.0" } }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, "range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -9729,15 +8968,11 @@ "util-deprecate": "~1.0.1" } }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "optional": true, - "requires": { - "picomatch": "^2.2.1" - } + "readline": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/readline/-/readline-1.3.0.tgz", + "integrity": "sha1-xYDXfvLPyHUrEySYBg3JeTp6wBw=", + "dev": true }, "realpath-native": { "version": "2.0.0", @@ -10069,16 +9304,6 @@ "glob": "^7.1.3" } }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, "rsvp": { "version": "4.8.5", "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", @@ -10094,15 +9319,6 @@ "queue-microtask": "^1.2.2" } }, - "run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "dev": true, - "requires": { - "aproba": "^1.1.1" - } - }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -10353,9 +9569,9 @@ } }, "serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -10458,28 +9674,12 @@ } } }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, "setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -10732,12 +9932,6 @@ } } }, - "source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -10885,15 +10079,6 @@ "tweetnacl": "~0.14.0" } }, - "ssri": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", - "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==", - "dev": true, - "requires": { - "figgy-pudding": "^3.5.1" - } - }, "stack-utils": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.5.tgz", @@ -10944,45 +10129,6 @@ "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true }, - "stream-browserify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", - "dev": true, - "requires": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, - "stream-each": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", - "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - } - }, - "stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "dev": true - }, "string-length": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-length/-/string-length-3.1.0.tgz", @@ -11228,114 +10374,95 @@ } }, "terser-webpack-plugin": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz", - "integrity": "sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.4.tgz", + "integrity": "sha512-E2CkNMN+1cho04YpdANyRrn8CyN4yMy+WdFKZIySFZrGXZxJwJP6PMNGGc/Mcr6qygQHUUqRxnAPmi0M9f00XA==", "dev": true, "requires": { - "cacache": "^12.0.2", - "find-cache-dir": "^2.1.0", - "is-wsl": "^1.1.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^4.0.0", + "jest-worker": "^27.0.6", + "p-limit": "^3.1.0", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.0", "source-map": "^0.6.1", - "terser": "^4.1.2", - "webpack-sources": "^1.4.0", - "worker-farm": "^1.7.0" + "terser": "^5.7.2" }, "dependencies": { - "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "jest-worker": { + "version": "27.3.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.3.1.tgz", + "integrity": "sha512-ks3WCzsiZaOPJl/oMsDjaf0TRiSv7ctNgs0FqRr2nARsovz6AWWy4oLElwcquGSz692DzgZQrCLScPNs5YlC4g==", "dev": true, "requires": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" } }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { - "locate-path": "^3.0.0" + "yocto-queue": "^0.1.0" } }, - "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" } }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "requires": { - "find-up": "^3.0.0" + "has-flag": "^4.0.0" } }, - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "terser": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz", + "integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==", "dev": true, "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.20" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + } } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true } } }, @@ -11362,43 +10489,18 @@ "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", "dev": true }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, "thunky": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", "dev": true }, - "timers-browserify": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", - "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", - "dev": true, - "requires": { - "setimmediate": "^1.0.4" - } - }, "tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", "dev": true }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -11529,12 +10631,6 @@ "tslib": "^1.8.1" } }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -11581,12 +10677,6 @@ "mime-types": "~2.1.24" } }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -11654,24 +10744,6 @@ "set-value": "^2.0.1" } }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dev": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4" - } - }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -11774,20 +10846,17 @@ "dev": true }, "util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", - "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "version": "0.12.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.4.tgz", + "integrity": "sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw==", "dev": true, "requires": { - "inherits": "2.0.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - } + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "safe-buffer": "^5.1.2", + "which-typed-array": "^1.1.2" } }, "util-deprecate": { @@ -11876,12 +10945,6 @@ "extsprintf": "^1.2.0" } }, - "vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -11912,241 +10975,13 @@ } }, "watchpack": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", - "integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.2.0.tgz", + "integrity": "sha512-up4YAn/XHgZHIxFBVCdlMiWDj6WaLKpwVeGQk2I5thdYxF/KmF0aaz6TfJZ/hfl1h/XlcDr7k1KH7ThDagpFaA==", "dev": true, "requires": { - "chokidar": "^3.4.1", - "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0", - "watchpack-chokidar2": "^2.0.1" - } - }, - "watchpack-chokidar2": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz", - "integrity": "sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww==", - "dev": true, - "optional": true, - "requires": { - "chokidar": "^2.1.8" - }, - "dependencies": { - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "optional": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "optional": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true, - "optional": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "optional": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "dev": true, - "optional": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "optional": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "dev": true, - "optional": true - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "optional": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "optional": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "optional": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "optional": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "optional": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - } + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" } }, "wbuf": { @@ -12165,165 +11000,69 @@ "dev": true }, "webpack": { - "version": "4.46.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.46.0.tgz", - "integrity": "sha512-6jJuJjg8znb/xRItk7bkT0+Q7AHCYjjFnvKIWQPkNIOyRqoCGvkOs0ipeQzrqz4l5FtN5ZI/ukEHroeX/o1/5Q==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-module-context": "1.9.0", - "@webassemblyjs/wasm-edit": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0", - "acorn": "^6.4.1", - "ajv": "^6.10.2", - "ajv-keywords": "^3.4.1", + "version": "5.59.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.59.1.tgz", + "integrity": "sha512-I01IQV9K96FlpXX3V0L4nvd7gb0r7thfuu1IfT2P4uOHOA77nKARAKDYGe/tScSHKnffNIyQhLC8kRXzY4KEHQ==", + "dev": true, + "requires": { + "@types/eslint-scope": "^3.7.0", + "@types/estree": "^0.0.50", + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/wasm-edit": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "acorn": "^8.4.1", + "acorn-import-assertions": "^1.7.6", + "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.5.0", - "eslint-scope": "^4.0.3", + "enhanced-resolve": "^5.8.3", + "es-module-lexer": "^0.9.0", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.4", "json-parse-better-errors": "^1.0.2", - "loader-runner": "^2.4.0", - "loader-utils": "^1.2.3", - "memory-fs": "^0.4.1", - "micromatch": "^3.1.10", - "mkdirp": "^0.5.3", - "neo-async": "^2.6.1", - "node-libs-browser": "^2.2.1", - "schema-utils": "^1.0.0", - "tapable": "^1.1.3", - "terser-webpack-plugin": "^1.4.3", - "watchpack": "^1.7.4", - "webpack-sources": "^1.4.1" + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.1.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.1.3", + "watchpack": "^2.2.0", + "webpack-sources": "^3.2.0" }, "dependencies": { "acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", "dev": true }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "enhanced-resolve": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz", + "integrity": "sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==", "dev": true, "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" } }, "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" } }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } + "tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true } } }, @@ -13007,22 +11746,10 @@ } }, "webpack-sources": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", - "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", - "dev": true, - "requires": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.1.tgz", + "integrity": "sha512-t6BMVLQ0AkjBOoRTZgqrWm7xbXMBzD+XDq2EZ96+vMfn3qKgsvdXZhbPZ4ElUOpdv4u+iiGe+w3+J75iy/bYGA==", + "dev": true }, "websocket-driver": { "version": "0.7.4", @@ -13095,21 +11822,26 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "which-typed-array": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.7.tgz", + "integrity": "sha512-vjxaB4nfDqwKI0ws7wZpxIlde1XrLX5uB0ZjpfshgmapJMD7jJWhZI+yToJTqaFByF0eNBcYxbjmCzoRP7CfEw==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-abstract": "^1.18.5", + "foreach": "^2.0.5", + "has-tostringtag": "^1.0.0", + "is-typed-array": "^1.1.7" + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, - "worker-farm": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", - "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", - "dev": true, - "requires": { - "errno": "~0.1.7" - } - }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -13192,12 +11924,6 @@ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true - }, "y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", @@ -13244,6 +11970,12 @@ "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true } } } diff --git a/package.json b/package.json index ddc2bfb..267fd38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-otus-homework", - "version": "1.0.0", + "version": "1.0.2", "description": "", "main": "lesson2/index.js", "scripts": { @@ -23,6 +23,7 @@ "@typescript-eslint/parser": "^5.1.0", "babel-jest": "^25.2.4", "babel-loader": "^8.1.0", + "core-js": "^3.18.3", "eslint": "^7.32.0", "eslint-config-prettier": "^6.10.1", "eslint-config-standard": "^16.0.3", @@ -31,17 +32,27 @@ "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-promise": "^5.1.0", "eslint-plugin-react": "^7.26.1", + "fs": "0.0.1-security", "html-webpack-plugin": "^4.0.3", "jest": "^25.2.4", "prettier": "^2.0.2", + "readline": "^1.3.0", "ts-node": "^8.8.2", "typescript": "^3.9.10", - "webpack": "^4.46.0", + "util": "^0.12.4", + "webpack": "^5.19.0", "webpack-cli": "^3.3.12", "webpack-dev-server": "^3.10.3" }, - "dependencies": { - "core-js": "^3.18.3" - }, - "exclude": ["node_modules", "lib", "tests"] + "dependencies": {}, + "exclude": [ + "node_modules", + "lib", + "tests" + ], + "browser": { + "fs": false, + "path": false, + "os": false + } } diff --git a/webpack.config.js b/webpack.config.js index 9c67113..625720b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,12 @@ const path = require('path') module.exports = { - entry: 'src/lesson2/index.js', + entry: './src/lesson2/index.js', + resolve: { + fallback: { + fs: false + } + }, module: { rules: [ { test: /\.svg$/, use: 'svg-inline-loader' }, From 2fe1a13e8c082166ff63a20ba24799ded3484f0d Mon Sep 17 00:00:00 2001 From: "Vladimir.Sushchen" Date: Thu, 21 Oct 2021 17:11:47 +0300 Subject: [PATCH 6/8] change for eslint --- src/lesson2/parser.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lesson2/parser.ts b/src/lesson2/parser.ts index 265ac87..cb229cf 100644 --- a/src/lesson2/parser.ts +++ b/src/lesson2/parser.ts @@ -60,10 +60,12 @@ export const parser = function (line: string) { const isValidOperatorPush = (isNumber(prevItem) && !isNumber(item) && - mathOperators.hasOwnProperty(item)) || + // mathOperators.hasOwnProperty(item)) || + Object.prototype.hasOwnProperty.call(mathOperators, item)) || ((prevItem === '**' || prevItem === '!' || prevItem === ')') && !isNumber(item) && - mathOperators.hasOwnProperty(item)) || + // mathOperators.hasOwnProperty(item)) || + Object.prototype.hasOwnProperty.call(mathOperators, item)) || item === '(' || item === ')' From 144d6e1c9116ac500d778eb05eecb59c910bf71f Mon Sep 17 00:00:00 2001 From: Vladimir2308 Date: Thu, 21 Oct 2021 18:13:16 +0300 Subject: [PATCH 7/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68c3a55..77cacbf 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ https://github.com/nickovchinnikov/react-js-tutorial/pull/3 факториал ! Добавлена обработка скобок, в том числе вложенных -пример: (2 + 2) * 2 = 8 +пример: (((20 - 6!)**)/2+45^3)*12- (2^3)! Добавлена обработка текста без пробелов, формулы можно вводить прямым текстом Добавлены тесты From 59a77bd74ae6a6f50a3c6ea712216f0ae78a8457 Mon Sep 17 00:00:00 2001 From: Vladimir2308 Date: Thu, 21 Oct 2021 18:14:06 +0300 Subject: [PATCH 8/8] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 77cacbf..840bcb6 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,12 @@ https://github.com/nickovchinnikov/react-js-tutorial/pull/3 Добавлены тесты Установка зависимостей: ->npm i +npm i Запуск тестов ->npm t +npm t Запуск программы ->npm run calc +npm run calc Сборка ->npm run-script build +npm run-script build