diff --git a/.babelrc b/.babelrc index 812efc5966..4ab657393c 100644 --- a/.babelrc +++ b/.babelrc @@ -4,8 +4,6 @@ ], "plugins": ["@babel/plugin-transform-object-assign"], "ignore": [ - "dist/*.js", - "lib/**/*.js", - "es/**/*.js" + "lib/**/*.js" ] -} \ No newline at end of file +} diff --git a/.gitignore b/.gitignore index 2a4257e2c3..868ba92e8f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,13 +2,14 @@ .vscode .c9 _site -coverage *swp -node_modules *.log -dist -lib -es -.nyc_output *.bak + +node_modules +.nyc_output +/coverage + +/lib/**/*.js +/lib/**/*.map *.generated.js diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000000..c05798b969 --- /dev/null +++ b/.mailmap @@ -0,0 +1,28 @@ +Bartosz Leoniak +Benjamin Lucas +Eric Mansfield +Finn Pauls +Gary Passero +Harsh Gupta +Karl Lew +Horatiu Lazu +Michael M. +Oleg +Pat Grasso +Saket Saurabh +Sathish Kumar Subramani +Slava Ganzin +Stu Blair +Harry Sarson H.D. Sarson + + + +Timothy Lee +Tóth Róbert +Todd Morse + +Rogelio J. Baucells rjbaucells + + <30529574+paulobuchsbaum@users.noreply.github.com> +Paulo Buchsbaum + diff --git a/.travis.yml b/.travis.yml index 196adf79a6..d210e781bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: node_js node_js: - - 8 - 10 - 12 + - 14 script: npm run test:src diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000000..61b33b9649 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,139 @@ +# Authors ordered by first contribution. + +Jos de Jong +Bart Kiers +Bryan Cuccioli +Zak Zibrat +Jim Garrison +Sebastien Piquemal +Guillermo Indalecio +Waldir Pimenta +Elijah Insua +Marcus André +Daniel Levin +hama_du +Finn Pauls +Matt Traynham +Fabrice Colas +Rogelio J. Baucells +Niels Heisterkamp +Mitchel Kelonye +Pavel Panchekha +Owen Versteeg +Andy Pan +Ryan Seys +Favian Contreras +Kenan Yildirim +Pete Corey +Max Bruckner +Ole Kröger +J. Harshbarger +James Herdman +Nick Foti +Devan Patel +Kunal Vyas +Liam Newman +Alex Edgcomb +Ganga Christopher +Ubuntu +Sergey Romanov +Eric Mansfield +Veaceslav Grimalschi +Holman Gao +Robert Eisele +Tomek Wiszniewski +Ben Nelson +devdevdata222 +David Simons <12e.david@gmail.com> +john marinelli +paulmasson +Keunhong Park +Brett Jurgens +oyvindjam +Harsh Gupta +Stu Blair +Priidik Vaikla +Mathias Polligkeit +Horatiu Lazu +Thomas Brierley +Ekin Koc +Pat Grasso +Adam Butler +Timothy Lee +woylie +Harry Sarson +Sebastian Ruhleder +Maxired (Maxence Dalmais) +Adam Kelly +Troy Alford +Todd Morse +Dzmitry Litskalau +Max Kramer +Slava Ganzin +Gulfaraz Yasin +Tóth Róbert +Victor +viclai +PJ Hampton +Alexander Beyn +Vincent Lee +Karl Lew +mocking +Michael M. +Ivan Vergiliev +Paulo Buchsbaum +jeffreyshen19 +Oleg +Joel Hoover +denisx +Clément P +jean-emmanuel +pokeball99 +Robin Wieruch +Dakota Blair +Henrique Ferrolho +Jack Schmidt +Daniel Ruf +Saket Saurabh +Gary Passero +Chris Chudzicki +Daniel Kostro +Ben Weinshel +Honeybar +Amin Abdul Manaf +Jason Shin +Mathias Rasmussen +Sathish Kumar Subramani +dkenul +Gold Holk <85619andy@gmail.com> +Benjamin Lucas +Albert Emil +Maximilian +Rian McGuire +Jack Mason <42824992+jackcmason@users.noreply.github.com> +SzechuanSage +sam-19 +Chris Hadgis +Jackie Han +Kevin J +Vlad Levitskiy +Tom MacWright +0xflotus <0xflotus@gmail.com> +Waseem Yusuf +Tanmay +Clinton Curry +Arthur Guiot +Bartosz Leoniak +Veeloxfire <58116051+Veeloxfire@users.noreply.github.com> +Arkajit Mandal +David Bramwell <13053834+dbramwell@users.noreply.github.com> +Cameron Tacklind +Michal Grňo +Tom Hickson +dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> +Markel F +Lazersmoke +SungJinWoo-SL <56172528+SungJinWoo-SL@users.noreply.github.com> +Nick Ewing + +# Generated by tools/update-authors.js diff --git a/HISTORY.md b/HISTORY.md index 7b18c11eac..516d99db20 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,17 +1,90 @@ # History +# not yet published, version 7.2.0 -# not yet published, version 6.6.1 +- Implemented new function `diff`, see #1634, #1920. Thanks @Veeloxfire. + + +# 2020-07-13, version 7.1.0 + +- Implement support for recursion (self-referencing) of typed-functions, + new in `typed-function@2.0.0`. This fixes #1885: functions which where + extended with a new data type did not always work. Thanks @nickewing. +- Fix #1899: documentation on expression trees still using old namespace + `math.expression.node.*` instead of `math.*`. + + +# 2020-06-24, version 7.0.2 + +- Fix #1882: have `DenseMatrix.resize` and `SparseMatrix.resize` accept + `DenseMatrix` and `SparseMatrix` as inputs too, not only `Array`. +- Fix functions `sum`, `prod`, `min`, and `max` not throwing a conversion error + when passing a single string, like `sum("abc")`. + + +# 2020-05-30, version 7.0.1 + +- Fix #1844: clarify the documentation of function `eigs`. Thanks @Lazersmoke. +- Fix #1855: Fix error in the documentation for `math.nthRoots(x)`. +- Fix #1856: make the library robust against Object prototype pollution. + + +# 2020-05-07, version 7.0.0 + +Breaking changes: + +- Improvements in calculation of the `dot` product of complex values. + The first argument is now conjugated. See #1761. Thanks @m93a. +- Dropped official support for Node.js v8 which has reached end of life. +- Removed all deprecation warnings introduced in v6. + To upgrade smoothly from v5 to v7 or higher, upgrade to v6 first + and resolve all deprecation warnings. + + +# 2020-05-04, version 6.6.5 + +- Fix #1834: value `Infinity` cannot be serialized and deserialized. + This is solved now with a new `math.replacer` function used as + `JSON.stringify(value, math.replacer)`. +- Fix #1842: value `Infinity` not turned into the latex symbol `\\infty`. + + +# 2020-04-15, version 6.6.4 + +- Fix published files containing Windows line endings (CRLF instead of LF). + + +# 2020-04-10, version 6.6.3 + +- Fix #1813: bug in engineering notation for numbers of function `format`, + sometimes resulting in needless trailing zeros. +- Fix #1808: methods `.toNumber()` and `.toNumeric()` not working on a + unitless unit. +- Fix #1645: not being able to use named operators `mod`, `and`, `not`, `or`, + `xor`, `to`, `in` as object keys. Thanks @Veeloxfire. +- Fix `eigs` not using `config.epsilon`. + + +# 2020-03-29, version 6.6.2 + +- Fix #1789: Function `eigs` not calculating with BigNumber precision + when input contains BigNumbers. +- Run the build script during npm `prepare`, so you can use the library + directly when installing directly from git. See #1751. Thanks @cinderblock. + + +# 2020-02-26, version 6.6.1 - Fix #1725: simplify `a/(b/c)`. Thanks @dbramwell. +- Fix examples in documentation of `row` and `column`. # 2020-02-01, version 6.6.0 - Implemented function `eigs`, see #1705, #542 #1175. Thanks @arkajitmandal. -- Fixed #1727: validate matrix size when creating a `DenseMatrix` using +- Fixed #1727: validate matrix size when creating a `DenseMatrix` using `fromJSON`. -- Fixed `DenseMatrix.map` copying the size and datatype from the original +- Fixed `DenseMatrix.map` copying the size and datatype from the original matrix instead of checking the returned dimensions and type of the callback. - Add a caret to dependencies (like) `^1.2.3`) to allow downstream updates without having to await a new release of mathjs. @@ -19,7 +92,7 @@ # 2020-01-08, version 6.5.0 -- Implemented `baseName` option for `createUnit`, see #1707. +- Implemented `baseName` option for `createUnit`, see #1707. Thanks @ericman314. diff --git a/README.md b/README.md index dfb3c57e0f..05da0f9ea8 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ Math.js is an extensive math library for JavaScript and Node.js. It features a f [![Version](https://img.shields.io/npm/v/mathjs.svg)](https://www.npmjs.com/package/mathjs) [![Downloads](https://img.shields.io/npm/dm/mathjs.svg)](https://www.npmjs.com/package/mathjs) [![Build Status](https://img.shields.io/travis/josdejong/mathjs/master.svg)](https://travis-ci.org/josdejong/mathjs) -[![Greenkeeper badge](https://badges.greenkeeper.io/josdejong/mathjs.svg)](https://greenkeeper.io/) [![Maintenance](https://img.shields.io/maintenance/yes/2020.svg)](https://github.com/josdejong/mathjs/graphs/commit-activity) [![License](https://img.shields.io/github/license/josdejong/mathjs.svg)](https://github.com/josdejong/mathjs/blob/master/LICENSE) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjosdejong%2Fmathjs.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjosdejong%2Fmathjs?ref=badge_shield) diff --git a/bin/cli.js b/bin/cli.js index a4bc4ff3c3..b9a8de2fb9 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -58,7 +58,7 @@ const PRECISION = 14 // decimals * @return {*} */ function getMath () { - return require('../lib/bundleAny') + return require('../lib/cjs/bundleAny') } /** diff --git a/bin/repl.js b/bin/repl.js index 0147448bae..cee82d5e16 100755 --- a/bin/repl.js +++ b/bin/repl.js @@ -4,7 +4,7 @@ * This simply preloads mathjs and drops you into a REPL to * help interactive debugging. **/ -global.math = require('../lib/bundleAny') +global.math = require('../lib/cjs/bundleAny') const repl = require('repl') repl.start({ useGlobal: true }) diff --git a/core.js b/core.js deleted file mode 100644 index 6ad46fc63a..0000000000 --- a/core.js +++ /dev/null @@ -1,16 +0,0 @@ -const create = require('./lib/entry/mainAny').create -const typedDependencies = require('./lib/entry/dependenciesAny.generated').typedDependencies - -console.warn('Warning: ' + - 'The file "mathjs/core.js" is deprecated since v6.0.0. ' + - 'Please use the root "mathjs" instead') - -exports.create = function createLegacy (config) { - // TODO: wrap the function create in a warnOnce message - - const factories = { - createTyped: typedDependencies.createTyped - } - - return create(factories, config) -} diff --git a/docs/core/serialization.md b/docs/core/serialization.md index 81751c1701..368626e1d7 100644 --- a/docs/core/serialization.md +++ b/docs/core/serialization.md @@ -14,11 +14,23 @@ function: ```js const x = math.complex('2 + 3i') -const str = JSON.stringify(x) +const str = JSON.stringify(x, math.json.replacer) console.log(str) // outputs a string '{"mathjs":"Complex","re":2,"im":3}' ``` +> IMPORTANT: in most cases works, serialization correctly without +> passing the `math.json.replacer` function as second argument. This is because +> in most cases we can rely on the default behavior of JSON.stringify, which +> uses the `.toJSON` method on classes like `Unit` and `Complex` to correctly +> serialize them. However, there are a few special cases like the +> number `Infinity` which does require the replacer function in order to be +> serialized without losing information: without it, `Infinity` will be +> serialized as `"null"` and cannot be deserialized correctly. +> +> So, it's best to always pass the `math.json.replacer` function to prevent +> weird edge cases. + In order to deserialize a string, containing math.js data types, `JSON.parse` can be used. In order to recognize the data types of math.js, `JSON.parse` must be called with the reviver function of math.js: diff --git a/docs/expressions/customization.md b/docs/expressions/customization.md index 4c5fdc86d5..20895b2f8e 100644 --- a/docs/expressions/customization.md +++ b/docs/expressions/customization.md @@ -114,7 +114,9 @@ Where : - `args` is an Array with nodes of the parsed arguments. - `math` is the math namespace against which the expression was compiled. -- `scope` is the scope provided when evaluating the expression. +- `scope` is a shallow _copy_ of the `scope` object provided when evaluating + the expression, optionally extended with nested variables like a function + parameter `x` of in a custom defined function like `f(x) = x^2`. Raw functions must be imported in the `math` namespace, as they need to be processed at compile time. They are not supported when passed via a scope diff --git a/docs/expressions/expression_trees.md b/docs/expressions/expression_trees.md index 2aed72dfc2..70848708d2 100644 --- a/docs/expressions/expression_trees.md +++ b/docs/expressions/expression_trees.md @@ -23,10 +23,10 @@ In this case, the expression `sqrt(2 + x)` is parsed as: Alternatively, this expression tree can be build by manually creating nodes: ```js -const node1 = new math.expression.node.ConstantNode(2) -const node2 = new math.expression.node.SymbolNode('x') -const node3 = new math.expression.node.OperatorNode('+', 'add', [node1, node2]) -const node4 = new math.expression.node.FunctionNode('sqrt', [node3]) +const node1 = new math.ConstantNode(2) +const node2 = new math.SymbolNode('x') +const node3 = new math.OperatorNode('+', 'add', [node1, node2]) +const node4 = new math.FunctionNode('sqrt', [node3]) ``` The resulting expression tree with root node `node4` is equal to the expression @@ -198,7 +198,7 @@ All nodes have the following methods: const node = math.parse('x^2 + 5*x') const transformed = node.transform(function (node, path, parent) { if (node.isSymbolNode && node.name === 'x') { - return new math.expression.node.ConstantNode(3) + return new math.ConstantNode(3) } else { return node @@ -268,7 +268,7 @@ Each `Node` has the following properties: ## Nodes math.js has the following types of nodes. All nodes are available at the -namespace `math.expression.node`. +namespace `math`. ### AccessorNode @@ -290,9 +290,9 @@ Examples: ```js const node1 = math.parse('a[3]') -const object = new math.expression.node.SymbolNode('a') -const index = new math.expression.node.IndexNode([3]) -const node2 = new math.expression.node.AccessorNode(object, index) +const object = new math.SymbolNode('a') +const index = new math.IndexNode([3]) +const node2 = new math.AccessorNode(object, index) ``` @@ -313,10 +313,10 @@ Examples: ```js const node1 = math.parse('[1, 2, 3]') -const one = new math.expression.node.ConstantNode(1) -const two = new math.expression.node.ConstantNode(2) -const three = new math.expression.node.ConstantNode(3) -const node2 = new math.expression.node.ArrayNode([one, two, three]) +const one = new math.ConstantNode(1) +const two = new math.ConstantNode(2) +const three = new math.ConstantNode(3) +const node2 = new math.ArrayNode([one, two, three]) ``` @@ -341,9 +341,9 @@ Examples: ```js const node1 = math.parse('a = 3') -const object = new math.expression.node.SymbolNode('a') -const value = new math.expression.node.ConstantNode(3) -const node2 = new math.expression.node.AssignmentNode(object, value) +const object = new math.SymbolNode('a') +const value = new math.ConstantNode(3) +const node2 = new math.AssignmentNode(object, value) ``` @@ -370,17 +370,17 @@ Examples: ```js const block1 = math.parse('a=1; b=2; c=3') -const a = new math.expression.node.SymbolNode('a') -const one = new math.expression.node.ConstantNode(1) -const ass1 = new math.expression.node.AssignmentNode(a, one) +const a = new math.SymbolNode('a') +const one = new math.ConstantNode(1) +const ass1 = new math.AssignmentNode(a, one) -const b = new math.expression.node.SymbolNode('b') -const two = new math.expression.node.ConstantNode(2) -const ass2 = new math.expression.node.AssignmentNode(b, two) +const b = new math.SymbolNode('b') +const two = new math.ConstantNode(2) +const ass2 = new math.AssignmentNode(b, two) -const c = new math.expression.node.SymbolNode('c') -const three = new math.expression.node.ConstantNode(3) -const ass3 = new math.expression.node.AssignmentNode(c, three) +const c = new math.SymbolNode('c') +const three = new math.ConstantNode(3) +const ass3 = new math.AssignmentNode(c, three) const block2 = new BlockNode([ {node: ass1, visible: false}, @@ -409,12 +409,12 @@ Examples: ```js const node1 = math.parse('a > 0 ? a : -a') -const a = new math.expression.node.SymbolNode('a') -const zero = new math.expression.node.ConstantNode(0) -const condition = new math.expression.node.OperatorNode('>', 'larger', [a, zero]) +const a = new math.SymbolNode('a') +const zero = new math.ConstantNode(0) +const condition = new math.OperatorNode('>', 'larger', [a, zero]) const trueExpr = a -const falseExpr = new math.expression.node.OperatorNode('-', 'unaryMinus', [a]) -const node2 = new math.expression.node.ConditionalNode(condition, trueExpr, falseExpr) +const falseExpr = new math.OperatorNode('-', 'unaryMinus', [a]) +const node2 = new math.ConditionalNode(condition, trueExpr, falseExpr) ``` ### ConstantNode @@ -434,8 +434,8 @@ Examples: ```js const node1 = math.parse('2.4') -const node2 = new math.expression.node.ConstantNode(2.4) -const node3 = new math.expression.node.ConstantNode('foo') +const node2 = new math.ConstantNode(2.4) +const node3 = new math.ConstantNode('foo') ``` @@ -458,10 +458,10 @@ Examples: ```js const node1 = math.parse('f(x) = x^2') -const x = new math.expression.node.SymbolNode('x') -const two = new math.expression.node.ConstantNode(2) -const expr = new math.expression.node.OperatorNode('^', 'pow', [x, 2]) -const node2 = new math.expression.node.FunctionAssignmentNode('f', ['x'], expr) +const x = new math.SymbolNode('x') +const two = new math.ConstantNode(2) +const expr = new math.OperatorNode('^', 'pow', [x, 2]) +const node2 = new math.FunctionAssignmentNode('f', ['x'], expr) ``` @@ -483,8 +483,8 @@ Examples: ```js const node1 = math.parse('sqrt(4)') -const four = new math.expression.node.ConstantNode(4) -const node3 = new math.expression.node.FunctionNode(new SymbolNode('sqrt'), [four]) +const four = new math.ConstantNode(4) +const node3 = new math.FunctionNode(new SymbolNode('sqrt'), [four]) ``` @@ -515,14 +515,14 @@ Examples: ```js const node1 = math.parse('A[1:3, 2]') -const A = new math.expression.node.SymbolNode('A') -const one = new math.expression.node.ConstantNode(1) -const two = new math.expression.node.ConstantNode(2) -const three = new math.expression.node.ConstantNode(3) +const A = new math.SymbolNode('A') +const one = new math.ConstantNode(1) +const two = new math.ConstantNode(2) +const three = new math.ConstantNode(3) -const range = new math.expression.node.RangeNode(one, three) -const index = new math.expression.node.IndexNode([range, two]) -const node2 = new math.expression.node.AccessNode(A, index) +const range = new math.RangeNode(one, three) +const index = new math.IndexNode([range, two]) +const node2 = new math.AccessNode(A, index) ``` ### ObjectNode @@ -542,10 +542,10 @@ Examples: ```js const node1 = math.parse('{a: 1, b: 2, c: 3}') -const a = new math.expression.node.ConstantNode(1) -const b = new math.expression.node.ConstantNode(2) -const c = new math.expression.node.ConstantNode(3) -const node2 = new math.expression.node.ObjectNode({a: a, b: b, c: c}) +const a = new math.ConstantNode(1) +const b = new math.ConstantNode(2) +const c = new math.ConstantNode(3) +const node2 = new math.ObjectNode({a: a, b: b, c: c}) ``` @@ -565,8 +565,8 @@ Additional methods: like with a unary minus: ```js - const a = new math.expression.node.ConstantNode(2) - const b = new math.expression.node.OperatorNode('-', 'unaryMinus', [a]) + const a = new math.ConstantNode(2) + const b = new math.OperatorNode('-', 'unaryMinus', [a]) b.isUnary() // true ``` @@ -576,9 +576,9 @@ Additional methods: like with most regular operators: ```js - const a = new math.expression.node.ConstantNode(2) - const b = new math.expression.node.ConstantNode(3) - const c = new math.expression.node.OperatorNode('+', 'add', [a, b]) + const a = new math.ConstantNode(2) + const b = new math.ConstantNode(3) + const c = new math.OperatorNode('+', 'add', [a, b]) c.isBinary() // true ``` @@ -593,9 +593,9 @@ Examples: ```js const node1 = math.parse('2.3 + 5') -const a = new math.expression.node.ConstantNode(2.3) -const b = new math.expression.node.ConstantNode(5) -const node2 = new math.expression.node.OperatorNode('+', 'add', [a, b]) +const a = new math.ConstantNode(2.3) +const b = new math.ConstantNode(5) +const node2 = new math.OperatorNode('+', 'add', [a, b]) ``` ### ParenthesisNode @@ -615,8 +615,8 @@ Examples: ```js const node1 = math.parse('(1)') -const a = new math.expression.node.ConstantNode(1) -const node2 = new math.expression.node.ParenthesisNode(a) +const a = new math.ConstantNode(1) +const node2 = new math.ParenthesisNode(a) ``` ### RangeNode @@ -639,13 +639,13 @@ Examples: const node1 = math.parse('1:10') const node2 = math.parse('0:2:10') -const zero = new math.expression.node.ConstantNode(0) -const one = new math.expression.node.ConstantNode(1) -const two = new math.expression.node.ConstantNode(2) -const ten = new math.expression.node.ConstantNode(10) +const zero = new math.ConstantNode(0) +const one = new math.ConstantNode(1) +const two = new math.ConstantNode(2) +const ten = new math.ConstantNode(10) -const node3 = new math.expression.node.RangeNode(one, ten) -const node4 = new math.expression.node.RangeNode(zero, ten, two) +const node3 = new math.RangeNode(one, ten) +const node4 = new math.RangeNode(zero, ten, two) ``` ### RelationalNode @@ -669,11 +669,11 @@ Examples: ```js -const ten = new Math.expression.node.ConstantNode(10) -const x = new Math.expression.node.SymbolNode('x') -const fifty = new Math.expression.node.ConstantNode(50) +const ten = new math.ConstantNode(10) +const x = new math.SymbolNode('x') +const fifty = new math.ConstantNode(50) -const node1 = new math.expression.node.RelationalNode(['smaller', 'smallerEq'], [ten, x, fifty]) +const node1 = new math.RelationalNode(['smaller', 'smallerEq'], [ten, x, fifty]) const node2 = math.parse('10 < x <= 50') ``` @@ -695,5 +695,5 @@ Examples: ```js const node = math.parse('x') -const x = new math.expression.node.SymbolNode('x') +const x = new math.SymbolNode('x') ``` diff --git a/docs/expressions/syntax.md b/docs/expressions/syntax.md index 4cc2121bb4..e9aa0a7321 100644 --- a/docs/expressions/syntax.md +++ b/docs/expressions/syntax.md @@ -65,7 +65,7 @@ Operator | Name | Syntax | Associativity | Example `./` | Element-wise divide | `x ./ y` | Left to right | `[9,6,4] ./ [3,2,2]` | `[3,3,2]` `%`, `mod` | Modulus | `x % y` | Left to right | `8 % 3` | `2` `^` | Power | `x ^ y` | Right to left | `2 ^ 3` | `8` -`.^` | Element-wise power | `x .^ y` | Right to left | `[2,3] .^ [3,3]` | `[9,27]` +`.^` | Element-wise power | `x .^ y` | Right to left | `[2,3] .^ [3,3]` | `[8,27]` `'` | Transpose | `y'` | Left to right | `[[1,2],[3,4]]'` | `[[1,3],[2,4]]` `!` | Factorial | `y!` | Left to right | `5!` | `120` `&` | Bitwise and | `x & y` | Left to right | `5 & 3` | `1` diff --git a/examples/advanced/custom_argument_parsing.js b/examples/advanced/custom_argument_parsing.js index 7b66e85f9d..19198b8df3 100644 --- a/examples/advanced/custom_argument_parsing.js +++ b/examples/advanced/custom_argument_parsing.js @@ -40,7 +40,7 @@ function integrate (f, start, end, step) { * math.evaluate('integrate(2*x, x, 0, 2)') * math.evaluate('integrate(2*x, x, 0, 2, 0.01)') * - * @param {Array.} args + * @param {Array.} args * Expects the following arguments: [f, x, start, end, step] * @param {Object} math * @param {Object} [scope] diff --git a/examples/advanced/custom_evaluate_using_factories.js b/examples/advanced/custom_evaluate_using_factories.js new file mode 100644 index 0000000000..e8788453b3 --- /dev/null +++ b/examples/advanced/custom_evaluate_using_factories.js @@ -0,0 +1,19 @@ +const { create, evaluateDependencies, factory } = require('../..') + +// custom implementations of all functions you want to support +const add = (a, b) => a + b +const subtract = (a, b) => a - b +const multiply = (a, b) => a * b +const divide = (a, b) => a / b + +// create factories for the functions, and create an evaluate function with those +// these functions will also be used by the classes like Unit. +const { evaluate } = create({ + evaluateDependencies, + createAdd: factory('add', [], () => add), + createSubtract: factory('subtract', [], () => subtract), + createMultiply: factory('multiply', [], () => multiply), + createDivide: factory('divide', [], () => divide) +}) + +console.log(evaluate('2 + 3 * 4')) // 14 diff --git a/examples/advanced/custom_evaluate_using_import.js b/examples/advanced/custom_evaluate_using_import.js new file mode 100644 index 0000000000..3c486b3be3 --- /dev/null +++ b/examples/advanced/custom_evaluate_using_import.js @@ -0,0 +1,18 @@ +const { create, evaluateDependencies } = require('../..') + +// custom implementations of all functions you want to support +const add = (a, b) => a + b +const subtract = (a, b) => a - b +const multiply = (a, b) => a * b +const divide = (a, b) => a / b + +// create a mathjs instance with hardly any functions +// there are some functions created which are used internally by evaluate though, +// for example by the Unit class which has dependencies on addScalar, subtract, +// multiplyScalar, etc. +const math = create(evaluateDependencies) + +// import your own functions +math.import({ add, subtract, multiply, divide }, { override: true }) + +console.log(math.evaluate('2 + 3 * 4')) // 14 diff --git a/examples/browser/currency_conversion.html b/examples/browser/currency_conversion.html index 613ce38b7f..293e80baa0 100644 --- a/examples/browser/currency_conversion.html +++ b/examples/browser/currency_conversion.html @@ -83,7 +83,7 @@

Currency conversion with math.js

function fetchAndImportCurrencies (accessKey) { // fetch actual currency conversion rates - return fetch('https://data.fixer.io/api/latest?access_key=' + accessKey) + return fetch('http://data.fixer.io/api/latest?access_key=' + accessKey) .then(function (response) { return response.json() }) diff --git a/examples/browser/webworkers/worker.js b/examples/browser/webworkers/worker.js index 708268240d..4abd330c20 100644 --- a/examples/browser/webworkers/worker.js +++ b/examples/browser/webworkers/worker.js @@ -19,7 +19,7 @@ self.addEventListener('message', function (event) { // build a response const response = { id: request.id, - result: result, + result: self.math.format(result), err: err } diff --git a/examples/expressions.js b/examples/expressions.js index 60f4ccbc0a..cbc509814b 100644 --- a/examples/expressions.js +++ b/examples/expressions.js @@ -166,7 +166,7 @@ console.log('x =', x) // x = 3.5 const f2 = parser.get('f2') console.log('f2 =', math.format(f2)) // f2 = f2(x, y) const h = f2(3, 3) -console.log('h =', h) // g = 27 +console.log('h =', h) // h = 27 parser.set('i', 500) print(parser.evaluate('i / 2')) // 250 diff --git a/examples/serialization.js b/examples/serialization.js index f2c2e43e3f..a7a52bbd67 100644 --- a/examples/serialization.js +++ b/examples/serialization.js @@ -1,9 +1,10 @@ // load math.js (using node.js) -const { complex, reviver, typeOf } = require('..') +const { complex, replacer, reviver, typeOf } = require('..') // serialize a math.js data type into a JSON string +// the replacer function is needed to correctly stringify a value like Infinity const x = complex('2+3i') -const str1 = JSON.stringify(x) +const str1 = JSON.stringify(x, replacer) console.log(str1) // outputs {"mathjs":"Complex","re":2,"im":3} diff --git a/gulpfile.js b/gulpfile.cjs similarity index 74% rename from gulpfile.js rename to gulpfile.cjs index ce2438f96f..89c2977d4e 100644 --- a/gulpfile.js +++ b/gulpfile.cjs @@ -11,24 +11,31 @@ const docgenerator = require('./tools/docgenerator') const entryGenerator = require('./tools/entryGenerator') const validateAsciiChars = require('./tools/validateAsciiChars') -const ENTRY = './src/bundleAny.js' -const HEADER = './src/header.js' -const VERSION = './src/version.js' -const COMPILE_SRC = './src/**/*.js' -const COMPILE_ENTRY_SRC = './src/entry/**/*.js' -const COMPILE_LIB = './lib' -const COMPILE_ES = './es' // es modules -const COMPILE_ENTRY_LIB = './lib/entry' -const COMPILED_MAIN_ANY = './lib/entry/mainAny.js' +const SRC_DIR = path.join(__dirname, '/src') +const ENTRY = `${SRC_DIR}/bundleAny.cjs` +const HEADER = `${SRC_DIR}/header.js` +const VERSION = `${SRC_DIR}/version.js` +const COMPILE_SRC = `${SRC_DIR}/**/*.?(c)js` +const COMPILE_ENTRY_SRC = `${SRC_DIR}/entry/**/*.js` + +const COMPILE_DIR = path.join(__dirname, '/lib') +const COMPILE_CJS = `${COMPILE_DIR}/cjs` +const COMPILE_ESM = `${COMPILE_DIR}/esm` // es modules +const COMPILE_ENTRY_LIB = `${COMPILE_CJS}/entry` + const FILE = 'math.js' const FILE_MIN = 'math.min.js' const FILE_MAP = 'math.min.map' -const DIST = path.join(__dirname, '/dist') -const REF_SRC = './lib/' -const REF_DEST = './docs/reference/functions' -const REF_ROOT = './docs/reference' -const MATH_JS = DIST + '/' + FILE -const COMPILED_HEADER = COMPILE_LIB + '/header.js' + +const DIST = `${COMPILE_DIR}/browser` + +const REF_SRC = `${COMPILE_CJS}/` +const REF_DIR = path.join(__dirname, '/docs') +const REF_DEST = `${REF_DIR}/reference/functions` +const REF_ROOT = `${REF_DIR}/reference` + +const MATH_JS = `${DIST}/${FILE}` +const COMPILED_HEADER = `${COMPILE_CJS}/header.js` // read the version number from package.json function getVersion () { @@ -49,9 +56,10 @@ function createBanner () { function updateVersionFile (done) { const version = getVersion() - fs.writeFileSync(VERSION, 'export const version = \'' + version + '\'\n' + - '// Note: This file is automatically generated when building math.js.\n' + - '// Changes made in this file will be overwritten.\n') + fs.writeFileSync(VERSION, `export const version = '${version}' +// Note: This file is automatically generated when building math.js. +// Changes made in this file will be overwritten. +`) done() } @@ -129,7 +137,7 @@ function bundle (done) { done(new Error('Compile failed')) } - log('bundled ' + MATH_JS) + log(`bundled ${MATH_JS}`) done() }) @@ -138,7 +146,7 @@ function bundle (done) { function compile () { return gulp.src(COMPILE_SRC) .pipe(babel()) - .pipe(gulp.dest(COMPILE_LIB)) + .pipe(gulp.dest(COMPILE_CJS)) } function compileESModules () { @@ -149,11 +157,14 @@ function compileESModules () { ...babelOptions, presets: [ ['@babel/preset-env', { - modules: false + modules: false, + targets: { + esmodules: true + } }] ] })) - .pipe(gulp.dest(COMPILE_ES)) + .pipe(gulp.dest(COMPILE_ESM)) } function compileEntryFiles () { @@ -183,8 +194,8 @@ function minify (done) { fs.writeFileSync(FILE_MIN, result.code) fs.writeFileSync(FILE_MAP, result.map) - log('Minified ' + FILE_MIN) - log('Mapped ' + FILE_MAP) + log(`Minified ${FILE_MIN}`) + log(`Mapped ${FILE_MAP}`) } finally { process.chdir(oldCwd) } @@ -196,7 +207,7 @@ function validateAscii (done) { const Reset = '\x1b[0m' const BgRed = '\x1b[41m' - validateAsciiChars.getAllFiles('./src') + validateAsciiChars.getAllFiles(SRC_DIR) .map(validateAsciiChars.validateChars) .forEach(function (invalidChars) { invalidChars.forEach(function (res) { @@ -232,33 +243,32 @@ function generateEntryFiles (done) { done() } -// Add links to deprecated functions in the node.js transpiled code mainAny.js -// These names are not valid in ES6 where we use them as functions instead of properties. -function addDeprecatedFunctions (done) { - const code = String(fs.readFileSync(COMPILED_MAIN_ANY)) - - const updatedCode = code + '\n\n' + - 'exports[\'var\'] = exports.deprecatedVar;\n' + - 'exports[\'typeof\'] = exports.deprecatedTypeof;\n' + - 'exports[\'eval\'] = exports.deprecatedEval;\n' + - 'exports[\'import\'] = exports.deprecatedImport;\n' - - fs.writeFileSync(COMPILED_MAIN_ANY, updatedCode) - - log('Added deprecated functions to ' + COMPILED_MAIN_ANY) - - done() -} - +/** + * Remove generated files + * + * @returns {Promise | *} + */ function clean () { return del([ - 'dist/**/*', - 'es/**/*', - 'lib/**/*', + // legacy compiled files + './dist/', + './es/', + + // everything in the lib directory, except the `cjs/package.json` file + './lib/!(cjs)', + './lib/cjs/!(package.json)', + + // generated source files 'src/**/*.generated.js' ]) } +gulp.task('browser', gulp.series(bundle, minify)) + +gulp.task('cjs', clean) + +gulp.task('docs', generateDocs) + // check whether any of the source files contains non-ascii characters gulp.task('validate:ascii', validateAscii) @@ -273,20 +283,18 @@ gulp.task('watch', function watch () { delay: 100 } - gulp.watch(files, options, gulp.parallel(bundle, compile, addDeprecatedFunctions)) + gulp.watch(files, options, gulp.parallel(bundle, compile)) }) // The default task (called when you run `gulp`) gulp.task('default', gulp.series( - clean, + 'clean', updateVersionFile, compile, generateEntryFiles, compileEntryFiles, compileESModules, // Must be after generateEntryFiles writeCompiledHeader, - addDeprecatedFunctions, - bundle, - minify, - generateDocs + 'browser', + 'docs' )) diff --git a/index.js b/index.js deleted file mode 100644 index 97a66f44ac..0000000000 --- a/index.js +++ /dev/null @@ -1,5 +0,0 @@ -console.warn('Warning: ' + - 'The file "mathjs/index.js" is deprecated since v6.0.0. ' + - 'Please use the root "mathjs" instead') - -module.exports = require('./lib/entry/mainAny') diff --git a/lib/cjs/package.json b/lib/cjs/package.json new file mode 100644 index 0000000000..5bbefffbab --- /dev/null +++ b/lib/cjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/main/es5/index.js b/main/es5/index.js deleted file mode 100644 index e634b753d9..0000000000 --- a/main/es5/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../../lib/entry/mainAny') diff --git a/main/es5/number.js b/main/es5/number.js deleted file mode 100644 index 91599f4faf..0000000000 --- a/main/es5/number.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../../lib/entry/mainNumber') diff --git a/main/es6/index.js b/main/es6/index.js deleted file mode 100644 index 1bc024ed56..0000000000 --- a/main/es6/index.js +++ /dev/null @@ -1,4 +0,0 @@ -export * from '../../src/entry/mainAny' - -console.log('Entry file "/es6/index.js" is deprecated. ' + - 'Please use "./esm/index.js" instead.') diff --git a/main/es6/number.js b/main/es6/number.js deleted file mode 100644 index e014d805af..0000000000 --- a/main/es6/number.js +++ /dev/null @@ -1,4 +0,0 @@ -export * from '../../src/entry/mainNumber' - -console.log('Entry file "/es6/number.js" is deprecated. ' + - 'Please use "./esm/number.js" instead.') diff --git a/main/esm/index.js b/main/esm/index.js deleted file mode 100644 index 3ae25aab13..0000000000 --- a/main/esm/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from '../../es/entry/mainAny' diff --git a/main/esm/number.js b/main/esm/number.js deleted file mode 100644 index e77688dcfb..0000000000 --- a/main/esm/number.js +++ /dev/null @@ -1 +0,0 @@ -export * from '../../es/entry/mainNumber' diff --git a/misc/how_to_publish.md b/misc/how_to_publish.md index 048aaaa3aa..050a1f86ce 100644 --- a/misc/how_to_publish.md +++ b/misc/how_to_publish.md @@ -16,6 +16,13 @@ Update the date and version number in the file `HISTORY.md`. Verify whether all changes in the new version are described. +## Update authors + +Run: + + npm run update-authors + + ## Build and test Build the distribution files in folders `dist` and `lib`, and test everything by running: diff --git a/number.js b/number.js deleted file mode 100644 index 02be3d4cd3..0000000000 --- a/number.js +++ /dev/null @@ -1 +0,0 @@ -export * from './main/esm/number' // eslint-disable-line diff --git a/package-lock.json b/package-lock.json index b80f91c014..4ac1262856 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,1408 +1,517 @@ { "name": "mathjs", - "version": "6.6.0", + "version": "7.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", "dev": true, "requires": { - "@babel/highlight": "^7.0.0" + "@babel/highlight": "^7.8.3" } }, "@babel/compat-data": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.8.5.tgz", - "integrity": "sha512-jWYUqQX/ObOhG1UiEkbH5SANsE/8oKXiQWjj7p7xgj9Zmnt//aUvyz4dBkK0HNsS8/cbyC5NmmH87VekW+mXFg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.10.4.tgz", + "integrity": "sha512-t+rjExOrSVvjQQXNp5zAIYDp00KjdvGl/TpDX5REPr0S9IAIPQMTilcfG6q8c0QFmj9lSTVySV2VTsyggvtNIw==", "dev": true, "requires": { - "browserslist": "^4.8.5", + "browserslist": "^4.12.0", "invariant": "^2.2.4", "semver": "^5.5.0" } }, "@babel/core": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.4.tgz", - "integrity": "sha512-0LiLrB2PwrVI+a2/IEskBopDYSd8BCb3rOvH7D5tzoWd696TBEduBvuLVm4Nx6rltrLZqvI3MCalB2K2aVzQjA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.4", - "@babel/helpers": "^7.8.4", - "@babel/parser": "^7.8.4", - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.4", - "@babel/types": "^7.8.3", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.5.tgz", + "integrity": "sha512-O34LQooYVDXPl7QWCdW9p4NR+QlzOr7xShPPJz8GsuCU3/8ua/wqTr7gmnxXv+WBESiGU/G5s16i6tUvHkNb+w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.5", + "@babel/helper-module-transforms": "^7.10.5", + "@babel/helpers": "^7.10.4", + "@babel/parser": "^7.10.5", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.5", + "@babel/types": "^7.10.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", - "json5": "^2.1.0", - "lodash": "^4.17.13", + "json5": "^2.1.2", + "lodash": "^4.17.19", "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" }, "dependencies": { "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", "dev": true, "requires": { - "@babel/highlight": "^7.8.3" + "@babel/highlight": "^7.10.4" } }, "@babel/generator": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", - "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.5.tgz", + "integrity": "sha512-3vXxr3FEW7E7lJZiWQ3bM4+v/Vyr9C+hpolQ8BGFr9Y8Ri2tFLWTixmwKBafDujO1WVah4fhZBeU1bieKdghig==", "dev": true, "requires": { - "@babel/types": "^7.8.3", + "@babel/types": "^7.10.5", "jsesc": "^2.5.1", - "lodash": "^4.17.13", "source-map": "^0.5.0" } }, - "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", + "@babel/helper-module-transforms": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.5.tgz", + "integrity": "sha512-4P+CWMJ6/j1W915ITJaUkadLObmCRRSC234uctJfn/vHrsLNxsR8dwlcXv9ZhJWzl77awf+mWXSZEKt5t0OnlA==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.5", + "lodash": "^4.17.19" } }, - "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true }, "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", "dev": true, "requires": { + "@babel/helper-validator-identifier": "^7.10.4", "chalk": "^2.0.0", - "esutils": "^2.0.2", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.5.tgz", + "integrity": "sha512-wfryxy4bE1UivvQKSQDU4/X6dr+i8bctjUjj8Zyt3DQy7NtPizJXT8M52nqpNKL+nq2PW8lxk4ZqLj0fD4B4hQ==", "dev": true }, - "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, "@babel/traverse": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", - "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.5.tgz", + "integrity": "sha512-yc/fyv2gUjPqzTz0WHeRJH2pv7jA9kA7mBX2tXl/x5iOE81uaVPuGPtaYk7wmkx4b67mQ7NqI8rmT2pF47KYKQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.4", - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.4", - "@babel/types": "^7.8.3", + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/parser": "^7.10.5", + "@babel/types": "^7.10.5", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.13" + "lodash": "^4.17.19" } }, "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.5.tgz", + "integrity": "sha512-ixV66KWfCI6GKoA/2H9v6bQdbfXEwwpOdQ8cRvb4F+eyvhlaHxWFMQB4+3d9QFJXZsiiiqVrewNV0DFEQpyT4Q==", "dev": true, "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } } } }, "@babel/generator": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.7.tgz", - "integrity": "sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.4.tgz", + "integrity": "sha512-toLIHUIAgcQygFZRAQcsLQV3CBuX6yOIru1kJk/qqqvcRmZrYe6WavZTSG+bB8MxhnL9YPf+pKQfuiP161q7ng==", "dev": true, "requires": { - "@babel/types": "^7.7.4", + "@babel/types": "^7.10.4", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" } }, "@babel/helper-annotate-as-pure": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.8.3.tgz", - "integrity": "sha512-6o+mJrZBxOoEX77Ezv9zwW7WV8DdluouRKNY/IR5u/YTMuKHgugHOzYWlYvYLpLA9nPsQCAAASpCIbjI9Mv+Uw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz", + "integrity": "sha512-XQlqKQP4vXFB7BN8fEEerrmYvHp3fK/rBkRFz9jaJbzK0B1DSfej9Kc7ZzE8Z/OnId1jpJdNAZ3BFQjWG68rcA==", "dev": true, "requires": { - "@babel/types": "^7.8.3" - }, - "dependencies": { - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "@babel/types": "^7.10.4" } }, "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.8.3.tgz", - "integrity": "sha512-5eFOm2SyFPK4Rh3XMMRDjN7lBH0orh3ss0g3rTYZnBQ+r6YPj7lgDyCvPphynHvUrobJmeMignBr6Acw9mAPlw==", - "dev": true, - "requires": { - "@babel/helper-explode-assignable-expression": "^7.8.3", - "@babel/types": "^7.8.3" - }, - "dependencies": { - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/helper-call-delegate": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.8.3.tgz", - "integrity": "sha512-6Q05px0Eb+N4/GTyKPPvnkig7Lylw+QzihMpws9iiZQv7ZImf84ZsZpQH7QoWN4n4tm81SnSzPgHw2qtO0Zf3A==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz", + "integrity": "sha512-L0zGlFrGWZK4PbT8AszSfLTM5sDU1+Az/En9VrdT8/LmEiJt4zXt+Jve9DCAnQcbqDhCI+29y/L93mrDzddCcg==", "dev": true, "requires": { - "@babel/helper-hoist-variables": "^7.8.3", - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/generator": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", - "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - } - }, - "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", - "dev": true - }, - "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/traverse": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", - "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.4", - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.4", - "@babel/types": "^7.8.3", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "@babel/helper-explode-assignable-expression": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-compilation-targets": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.4.tgz", - "integrity": "sha512-3k3BsKMvPp5bjxgMdrFyq0UaEO48HciVrOVF0+lon8pp95cyJ2ujAh0TrBHNMnJGT2rr0iKOJPFFbSqjDyf/Pg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.10.4.tgz", + "integrity": "sha512-a3rYhlsGV0UHNDvrtOXBg8/OpfV0OKTkxKPzIplS1zpx7CygDcWWxckxZeDd3gzPzC4kUT0A4nVFDK0wGMh4MQ==", "dev": true, "requires": { - "@babel/compat-data": "^7.8.4", - "browserslist": "^4.8.5", + "@babel/compat-data": "^7.10.4", + "browserslist": "^4.12.0", "invariant": "^2.2.4", "levenary": "^1.1.1", "semver": "^5.5.0" } }, + "@babel/helper-create-class-features-plugin": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.4.tgz", + "integrity": "sha512-9raUiOsXPxzzLjCXeosApJItoMnX3uyT4QdM2UldffuGApNrF8e938MwNpDCK9CPoyxrEoCgT+hObJc3mZa6lQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4" + } + }, "@babel/helper-create-regexp-features-plugin": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.3.tgz", - "integrity": "sha512-Gcsm1OHCUr9o9TcJln57xhWHtdXbA2pgQ58S0Lxlks0WMGNXuki4+GLfX0p+L2ZkINUGZvfkz8rzoqJQSthI+Q==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.10.4.tgz", + "integrity": "sha512-2/hu58IEPKeoLF45DBwx3XFqsbCXmkdAay4spVr2x0jYgRxrSNp+ePwvSsy9g6YSaNDcKIQVPXk1Ov8S2edk2g==", "dev": true, "requires": { - "@babel/helper-regex": "^7.8.3", - "regexpu-core": "^4.6.0" + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-regex": "^7.10.4", + "regexpu-core": "^4.7.0" } }, "@babel/helper-define-map": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.8.3.tgz", - "integrity": "sha512-PoeBYtxoZGtct3md6xZOCWPcKuMuk3IHhgxsRRNtnNShebf4C8YonTSblsK4tvDbm+eJAw2HAPOfCr+Q/YRG/g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.4.tgz", + "integrity": "sha512-nIij0oKErfCnLUCWaCaHW0Bmtl2RO9cN7+u2QT8yqTywgALKlyUVOvHDElh+b5DwVC6YB1FOYFOTWcN/+41EDA==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.8.3", - "@babel/types": "^7.8.3", + "@babel/helper-function-name": "^7.10.4", + "@babel/types": "^7.10.4", "lodash": "^4.17.13" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", - "dev": true - }, - "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } } }, "@babel/helper-explode-assignable-expression": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.8.3.tgz", - "integrity": "sha512-N+8eW86/Kj147bO9G2uclsg5pwfs/fqqY5rwgIL7eTBklgXjcOJ3btzS5iM6AitJcftnY7pm2lGsrJVYLGjzIw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.10.4.tgz", + "integrity": "sha512-4K71RyRQNPRrR85sr5QY4X3VwG4wtVoXZB9+L3r1Gp38DhELyHCtovqydRi7c1Ovb17eRGiQ/FD5s8JdU0Uy5A==", "dev": true, "requires": { - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/generator": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", - "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - } - }, - "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", - "dev": true - }, - "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/traverse": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", - "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.4", - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.4", - "@babel/types": "^7.8.3", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-function-name": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", - "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-get-function-arity": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", - "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", "dev": true, "requires": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.10.4" } }, "@babel/helper-hoist-variables": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.8.3.tgz", - "integrity": "sha512-ky1JLOjcDUtSc+xkt0xhYff7Z6ILTAHKmZLHPxAhOP0Nd77O+3nCsd6uSVYur6nJnCI029CrNbYlc0LoPfAPQg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz", + "integrity": "sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA==", "dev": true, "requires": { - "@babel/types": "^7.8.3" - }, - "dependencies": { - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "@babel/types": "^7.10.4" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", - "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.4.tgz", + "integrity": "sha512-m5j85pK/KZhuSdM/8cHUABQTAslV47OjfIB9Cc7P+PvlAoBzdb79BGNfw8RhT5Mq3p+xGd0ZfAKixbrUZx0C7A==", "dev": true, "requires": { - "@babel/types": "^7.8.3" - }, - "dependencies": { - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "@babel/types": "^7.10.4" } }, "@babel/helper-module-imports": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", - "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", "dev": true, "requires": { - "@babel/types": "^7.8.3" - }, - "dependencies": { - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "@babel/types": "^7.10.4" } }, "@babel/helper-module-transforms": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.8.3.tgz", - "integrity": "sha512-C7NG6B7vfBa/pwCOshpMbOYUmrYQDfCpVL/JCRu0ek8B5p8kue1+BCXpg2vOYs7w5ACB9GTOBYQ5U6NwrMg+3Q==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.4.tgz", + "integrity": "sha512-Er2FQX0oa3nV7eM1o0tNCTx7izmQtwAQsIiaLRWtavAAEcskb0XJ5OjJbVrYXWOTr8om921Scabn4/tzlx7j1Q==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-simple-access": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3", + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4", "lodash": "^4.17.13" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", - "dev": true - }, - "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } } }, "@babel/helper-optimise-call-expression": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", - "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", "dev": true, "requires": { - "@babel/types": "^7.8.3" - }, - "dependencies": { - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "@babel/types": "^7.10.4" } }, "@babel/helper-plugin-utils": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", - "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", "dev": true }, "@babel/helper-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.8.3.tgz", - "integrity": "sha512-BWt0QtYv/cg/NecOAZMdcn/waj/5P26DR4mVLXfFtDokSR6fyuG0Pj+e2FqtSME+MqED1khnSMulkmGl8qWiUQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.10.4.tgz", + "integrity": "sha512-inWpnHGgtg5NOF0eyHlC0/74/VkdRITY9dtTpB2PrxKKn+AkVMRiZz/Adrx+Ssg+MLDesi2zohBW6MVq6b4pOQ==", "dev": true, "requires": { "lodash": "^4.17.13" } }, "@babel/helper-remap-async-to-generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.8.3.tgz", - "integrity": "sha512-kgwDmw4fCg7AVgS4DukQR/roGp+jP+XluJE5hsRZwxCYGg+Rv9wSGErDWhlI90FODdYfd4xG4AQRiMDjjN0GzA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.10.4.tgz", + "integrity": "sha512-86Lsr6NNw3qTNl+TBcF1oRZMaVzJtbWTyTko+CQL/tvNvcGYEFKbLXDPxtW0HKk3McNOk4KzY55itGWCAGK5tg==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-wrap-function": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/generator": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", - "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - } - }, - "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", - "dev": true - }, - "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/traverse": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", - "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.4", - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.4", - "@babel/types": "^7.8.3", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-wrap-function": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-replace-supers": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.3.tgz", - "integrity": "sha512-xOUssL6ho41U81etpLoT2RTdvdus4VfHamCuAm4AHxGr+0it5fnwoVdwUJ7GFEqCsQYzJUhcbsN9wB9apcYKFA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", + "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.8.3", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/generator": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", - "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - } - }, - "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", - "dev": true - }, - "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/traverse": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", - "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.4", - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.4", - "@babel/types": "^7.8.3", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-simple-access": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", - "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", + "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", "dev": true, "requires": { - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", - "dev": true - }, - "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-split-export-declaration": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", - "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.4.tgz", + "integrity": "sha512-pySBTeoUff56fL5CBU2hWm9TesA4r/rOkI9DyJLvvgz09MB9YtfIYe3iBriVaYNaPe+Alua0vBIOVOLs2buWhg==", "dev": true, "requires": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.10.4" } }, + "@babel/helper-validator-identifier": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", + "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "dev": true + }, "@babel/helper-wrap-function": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.8.3.tgz", - "integrity": "sha512-LACJrbUET9cQDzb6kG7EeD7+7doC3JNvUgTEQOx2qaO1fKlzE/Bf05qs9w1oXQMmXlPO65lC3Tq9S6gZpTErEQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.10.4.tgz", + "integrity": "sha512-6py45WvEF0MhiLrdxtRjKjufwLL1/ob2qDJgg5JgNdojBAZSAKnAjkyOCNug6n+OBl4VW76XjvgSFTdaMcW0Ug==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/generator": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", - "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - } - }, - "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", - "dev": true - }, - "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/traverse": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", - "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.4", - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.4", - "@babel/types": "^7.8.3", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "@babel/helper-function-name": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helpers": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.4.tgz", - "integrity": "sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", + "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", "dev": true, "requires": { - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.4", - "@babel/types": "^7.8.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/generator": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", - "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - } - }, - "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", - "dev": true - }, - "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/traverse": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", - "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.4", - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.4", - "@babel/types": "^7.8.3", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/highlight": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", - "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", "dev": true, "requires": { + "@babel/helper-validator-identifier": "^7.9.0", "chalk": "^2.0.0", - "esutils": "^2.0.2", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", - "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.4.tgz", + "integrity": "sha512-8jHII4hf+YVDsskTF6WuMB3X4Eh+PsUkC2ljq22so5rHvH+T8BzyL94VOdyFLNR8tBSVXOTbNHOKpR4TfRxVtA==", "dev": true }, "@babel/plugin-proposal-async-generator-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.8.3.tgz", - "integrity": "sha512-NZ9zLv848JsV3hs8ryEh7Uaz/0KsmPLqv0+PdkDJL1cJy0K4kOCFa8zc1E3mp+RHPQcpdfb/6GovEsW4VDrOMw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.10.4.tgz", + "integrity": "sha512-MJbxGSmejEFVOANAezdO39SObkURO5o/8b6fSH6D1pi9RZQt+ldppKPXfqgUWpSQ9asM6xaSaSJIaeWMDRP0Zg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-remap-async-to-generator": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-remap-async-to-generator": "^7.10.4", "@babel/plugin-syntax-async-generators": "^7.8.0" } }, + "@babel/plugin-proposal-class-properties": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.10.4.tgz", + "integrity": "sha512-vhwkEROxzcHGNu2mzUC0OFFNXdZ4M23ib8aRRcJSsW8BZK9pQMD7QB7csl97NBbgGZO7ZyHUyKDnxzOaP4IrCg==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, "@babel/plugin-proposal-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.8.3.tgz", - "integrity": "sha512-NyaBbyLFXFLT9FP+zk0kYlUlA8XtCUbehs67F0nnEg7KICgMc2mNkIeu9TYhKzyXMkrapZFwAhXLdnt4IYHy1w==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.10.4.tgz", + "integrity": "sha512-up6oID1LeidOOASNXgv/CFbgBqTuKJ0cJjz6An5tWD+NVBNlp3VNSBxv2ZdU7SYl3NxJC7agAQDApZusV6uFwQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", "@babel/plugin-syntax-dynamic-import": "^7.8.0" } }, "@babel/plugin-proposal-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.8.3.tgz", - "integrity": "sha512-KGhQNZ3TVCQG/MjRbAUwuH+14y9q0tpxs1nWWs3pbSleRdDro9SAMMDyye8HhY1gqZ7/NqIc8SKhya0wRDgP1Q==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.10.4.tgz", + "integrity": "sha512-fCL7QF0Jo83uy1K0P2YXrfX11tj3lkpN7l4dMv9Y9VkowkhkQDwFHFd8IiwyK5MZjE8UpbgokkgtcReH88Abaw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", "@babel/plugin-syntax-json-strings": "^7.8.0" } }, "@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-TS9MlfzXpXKt6YYomudb/KU7nQI6/xnapG6in1uZxoxDghuSMZsPb6D2fyUwNYSAp4l1iR7QtFOjkqcRYcUsfw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.10.4.tgz", + "integrity": "sha512-wq5n1M3ZUlHl9sqT2ok1T2/MTt6AXE0e1Lz4WzWBr95LsAZ5qDXe4KnFuauYyEyLiohvXFMdbsOTMyLZs91Zlw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" } }, + "@babel/plugin-proposal-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.10.4.tgz", + "integrity": "sha512-73/G7QoRoeNkLZFxsoCCvlg4ezE4eM+57PnOqgaPOozd5myfj7p0muD1mRVJvbUWbOzD+q3No2bWbaKy+DJ8DA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + } + }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-8qvuPwU/xxUCt78HocNlv0mXXo0wdh9VT1R04WU8HGOfaOob26pF+9P5/lYjN/q7DHOX1bvX60hnhOvuQUJdbA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.10.4.tgz", + "integrity": "sha512-6vh4SqRuLLarjgeOf4EaROJAHjvu9Gl+/346PbDH9yWbJyfnJ/ah3jmYKYtswEyCoWZiidvVHjHshd4WgjB9BA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0" + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-transform-parameters": "^7.10.4" } }, "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-0gkX7J7E+AtAw9fcwlVQj8peP61qhdg/89D5swOkjYbkboA2CVckn3kiyum1DE0wskGb7KJJxBdyEBApDLLVdw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.10.4.tgz", + "integrity": "sha512-LflT6nPh+GK2MnFiKDyLiqSqVHkQnVf7hdoAvyTnnKj9xB3docGRsdPuxp6qqqW19ifK3xgc9U5/FwrSaCNX5g==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", "@babel/plugin-syntax-optional-catch-binding": "^7.8.0" } }, "@babel/plugin-proposal-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.8.3.tgz", - "integrity": "sha512-QIoIR9abkVn+seDE3OjA08jWcs3eZ9+wJCKSRgo3WdEU2csFYgdScb+8qHB3+WXsGJD55u+5hWCISI7ejXS+kg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.10.4.tgz", + "integrity": "sha512-ZIhQIEeavTgouyMSdZRap4VPPHqJJ3NEs2cuHs5p0erH+iz6khB0qfgU8g7UuJkG88+fBMy23ZiU+nuHvekJeQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", "@babel/plugin-syntax-optional-chaining": "^7.8.0" } }, + "@babel/plugin-proposal-private-methods": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.10.4.tgz", + "integrity": "sha512-wh5GJleuI8k3emgTg5KkJK6kHNsGEr0uBTDBuQUBJwckk9xs1ez79ioheEVVxMLyPscB0LfkbVHslQqIzWV6Bw==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.8.3.tgz", - "integrity": "sha512-1/1/rEZv2XGweRwwSkLpY+s60za9OZ1hJs4YDqFHCw0kYWYwL5IFljVY1MYBL+weT1l9pokDO2uhSTLVxzoHkQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.10.4.tgz", + "integrity": "sha512-H+3fOgPnEXFL9zGYtKQe4IDOPKYlZdF1kqFDQRRb8PK4B8af1vAGK04tF5iQAAsui+mHNBQSAtd2/ndEDe9wuA==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-create-regexp-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-syntax-async-generators": { @@ -1414,6 +523,15 @@ "@babel/helper-plugin-utils": "^7.8.0" } }, + "@babel/plugin-syntax-class-properties": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.10.4.tgz", + "integrity": "sha512-GCSBF7iUle6rNugfURwNmCGG3Z/2+opxAMLs1nND4bhEG5PuxTIggDBoeYYSujAlLtsupzOHYJQgPS3pivwXIA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, "@babel/plugin-syntax-dynamic-import": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", @@ -1441,6 +559,15 @@ "@babel/helper-plugin-utils": "^7.8.0" } }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, "@babel/plugin-syntax-object-rest-spread": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", @@ -1469,639 +596,557 @@ } }, "@babel/plugin-syntax-top-level-await": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.8.3.tgz", - "integrity": "sha512-kwj1j9lL/6Wd0hROD3b/OZZ7MSrZLqqn9RAZ5+cYYsflQ9HZBIKCUkr3+uL1MEJ1NePiUbf98jjiMQSv0NMR9g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.10.4.tgz", + "integrity": "sha512-ni1brg4lXEmWyafKr0ccFWkJG0CeMt4WV1oyeBW6EFObF4oOHclbkj5cARxAPQyAQ2UTuplJyK4nfkXIMMFvsQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-arrow-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.8.3.tgz", - "integrity": "sha512-0MRF+KC8EqH4dbuITCWwPSzsyO3HIWWlm30v8BbbpOrS1B++isGxPnnuq/IZvOX5J2D/p7DQalQm+/2PnlKGxg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.10.4.tgz", + "integrity": "sha512-9J/oD1jV0ZCBcgnoFWFq1vJd4msoKb/TCpGNFyyLt0zABdcvgK3aYikZ8HjzB14c26bc7E3Q1yugpwGy2aTPNA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-async-to-generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.8.3.tgz", - "integrity": "sha512-imt9tFLD9ogt56Dd5CI/6XgpukMwd/fLGSrix2httihVe7LOGVPhyhMh1BU5kDM7iHD08i8uUtmV2sWaBFlHVQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.10.4.tgz", + "integrity": "sha512-F6nREOan7J5UXTLsDsZG3DXmZSVofr2tGNwfdrVwkDWHfQckbQXnXSPfD7iO+c/2HGqycwyLST3DnZ16n+cBJQ==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-remap-async-to-generator": "^7.8.3" + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-remap-async-to-generator": "^7.10.4" } }, "@babel/plugin-transform-block-scoped-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.8.3.tgz", - "integrity": "sha512-vo4F2OewqjbB1+yaJ7k2EJFHlTP3jR634Z9Cj9itpqNjuLXvhlVxgnjsHsdRgASR8xYDrx6onw4vW5H6We0Jmg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.10.4.tgz", + "integrity": "sha512-WzXDarQXYYfjaV1szJvN3AD7rZgZzC1JtjJZ8dMHUyiK8mxPRahynp14zzNjU3VkPqPsO38CzxiWO1c9ARZ8JA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-block-scoping": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.8.3.tgz", - "integrity": "sha512-pGnYfm7RNRgYRi7bids5bHluENHqJhrV4bCZRwc5GamaWIIs07N4rZECcmJL6ZClwjDz1GbdMZFtPs27hTB06w==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.10.4.tgz", + "integrity": "sha512-J3b5CluMg3hPUii2onJDRiaVbPtKFPLEaV5dOPY5OeAbDi1iU/UbbFFTgwb7WnanaDy7bjU35kc26W3eM5Qa0A==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", "lodash": "^4.17.13" } }, "@babel/plugin-transform-classes": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.8.3.tgz", - "integrity": "sha512-SjT0cwFJ+7Rbr1vQsvphAHwUHvSUPmMjMU/0P59G8U2HLFqSa082JO7zkbDNWs9kH/IUqpHI6xWNesGf8haF1w==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-define-map": "^7.8.3", - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.10.4.tgz", + "integrity": "sha512-2oZ9qLjt161dn1ZE0Ms66xBncQH4In8Sqw1YWgBUZuGVJJS5c0OFZXL6dP2MRHrkU/eKhWg8CzFJhRQl50rQxA==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-define-map": "^7.10.4", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", "globals": "^11.1.0" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", - "dev": true - }, - "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } } }, "@babel/plugin-transform-computed-properties": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.8.3.tgz", - "integrity": "sha512-O5hiIpSyOGdrQZRQ2ccwtTVkgUDBBiCuK//4RJ6UfePllUTCENOzKxfh6ulckXKc0DixTFLCfb2HVkNA7aDpzA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.10.4.tgz", + "integrity": "sha512-JFwVDXcP/hM/TbyzGq3l/XWGut7p46Z3QvqFMXTfk6/09m7xZHJUN9xHfsv7vqqD4YnfI5ueYdSJtXqqBLyjBw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-destructuring": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.8.3.tgz", - "integrity": "sha512-H4X646nCkiEcHZUZaRkhE2XVsoz0J/1x3VVujnn96pSoGCtKPA99ZZA+va+gK+92Zycd6OBKCD8tDb/731bhgQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.10.4.tgz", + "integrity": "sha512-+WmfvyfsyF603iPa6825mq6Qrb7uLjTOsa3XOFzlYcYDHSS4QmpOWOL0NNBY5qMbvrcf3tq0Cw+v4lxswOBpgA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-dotall-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.8.3.tgz", - "integrity": "sha512-kLs1j9Nn4MQoBYdRXH6AeaXMbEJFaFu/v1nQkvib6QzTj8MZI5OQzqmD83/2jEM1z0DLilra5aWO5YpyC0ALIw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.10.4.tgz", + "integrity": "sha512-ZEAVvUTCMlMFAbASYSVQoxIbHm2OkG2MseW6bV2JjIygOjdVv8tuxrCTzj1+Rynh7ODb8GivUy7dzEXzEhuPaA==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-create-regexp-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-duplicate-keys": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.8.3.tgz", - "integrity": "sha512-s8dHiBUbcbSgipS4SMFuWGqCvyge5V2ZeAWzR6INTVC3Ltjig/Vw1G2Gztv0vU/hRG9X8IvKvYdoksnUfgXOEQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.10.4.tgz", + "integrity": "sha512-GL0/fJnmgMclHiBTTWXNlYjYsA7rDrtsazHG6mglaGSTh0KsrW04qml+Bbz9FL0LcJIRwBWL5ZqlNHKTkU3xAA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-exponentiation-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.8.3.tgz", - "integrity": "sha512-zwIpuIymb3ACcInbksHaNcR12S++0MDLKkiqXHl3AzpgdKlFNhog+z/K0+TGW+b0w5pgTq4H6IwV/WhxbGYSjQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.10.4.tgz", + "integrity": "sha512-S5HgLVgkBcRdyQAHbKj+7KyuWx8C6t5oETmUuwz1pt3WTWJhsUV0WIIXuVvfXMxl/QQyHKlSCNNtaIamG8fysw==", "dev": true, "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-for-of": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.8.4.tgz", - "integrity": "sha512-iAXNlOWvcYUYoV8YIxwS7TxGRJcxyl8eQCfT+A5j8sKUzRFvJdcyjp97jL2IghWSRDaL2PU2O2tX8Cu9dTBq5A==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.10.4.tgz", + "integrity": "sha512-ItdQfAzu9AlEqmusA/65TqJ79eRcgGmpPPFvBnGILXZH975G0LNjP1yjHvGgfuCxqrPPueXOPe+FsvxmxKiHHQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.8.3.tgz", - "integrity": "sha512-rO/OnDS78Eifbjn5Py9v8y0aR+aSYhDhqAwVfsTl0ERuMZyr05L1aFSCJnbv2mmsLkit/4ReeQ9N2BgLnOcPCQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.10.4.tgz", + "integrity": "sha512-OcDCq2y5+E0dVD5MagT5X+yTRbcvFjDI2ZVAottGH6tzqjx/LKpgkUepu3hp/u4tZBzxxpNGwLsAvGBvQ2mJzg==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", - "dev": true - }, - "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.8.3.tgz", - "integrity": "sha512-3Tqf8JJ/qB7TeldGl+TT55+uQei9JfYaregDcEAyBZ7akutriFrt6C/wLYIer6OYhleVQvH/ntEhjE/xMmy10A==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.10.4.tgz", + "integrity": "sha512-Xd/dFSTEVuUWnyZiMu76/InZxLTYilOSr1UlHV+p115Z/Le2Fi1KXkJUYz0b42DfndostYlPub3m8ZTQlMaiqQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-member-expression-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.8.3.tgz", - "integrity": "sha512-3Wk2EXhnw+rP+IDkK6BdtPKsUE5IeZ6QOGrPYvw52NwBStw9V1ZVzxgK6fSKSxqUvH9eQPR3tm3cOq79HlsKYA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.10.4.tgz", + "integrity": "sha512-0bFOvPyAoTBhtcJLr9VcwZqKmSjFml1iVxvPL0ReomGU53CX53HsM4h2SzckNdkQcHox1bpAqzxBI1Y09LlBSw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-modules-amd": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.8.3.tgz", - "integrity": "sha512-MadJiU3rLKclzT5kBH4yxdry96odTUwuqrZM+GllFI/VhxfPz+k9MshJM+MwhfkCdxxclSbSBbUGciBngR+kEQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.10.4.tgz", + "integrity": "sha512-3Fw+H3WLUrTlzi3zMiZWp3AR4xadAEMv6XRCYnd5jAlLM61Rn+CRJaZMaNvIpcJpQ3vs1kyifYvEVPFfoSkKOA==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.0" + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "babel-plugin-dynamic-import-node": "^2.3.3" } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.8.3.tgz", - "integrity": "sha512-JpdMEfA15HZ/1gNuB9XEDlZM1h/gF/YOH7zaZzQu2xCFRfwc01NXBMHHSTT6hRjlXJJs5x/bfODM3LiCk94Sxg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.10.4.tgz", + "integrity": "sha512-Xj7Uq5o80HDLlW64rVfDBhao6OX89HKUmb+9vWYaLXBZOma4gA6tw4Ni1O5qVDoZWUV0fxMYA0aYzOawz0l+1w==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-simple-access": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.0" + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "babel-plugin-dynamic-import-node": "^2.3.3" } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.8.3.tgz", - "integrity": "sha512-8cESMCJjmArMYqa9AO5YuMEkE4ds28tMpZcGZB/jl3n0ZzlsxOAi3mC+SKypTfT8gjMupCnd3YiXCkMjj2jfOg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.10.4.tgz", + "integrity": "sha512-Tb28LlfxrTiOTGtZFsvkjpyjCl9IoaRI52AEU/VIwOwvDQWtbNJsAqTXzh+5R7i74e/OZHH2c2w2fsOqAfnQYQ==", "dev": true, "requires": { - "@babel/helper-hoist-variables": "^7.8.3", - "@babel/helper-module-transforms": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.0" + "@babel/helper-hoist-variables": "^7.10.4", + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "babel-plugin-dynamic-import-node": "^2.3.3" } }, "@babel/plugin-transform-modules-umd": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.8.3.tgz", - "integrity": "sha512-evhTyWhbwbI3/U6dZAnx/ePoV7H6OUG+OjiJFHmhr9FPn0VShjwC2kdxqIuQ/+1P50TMrneGzMeyMTFOjKSnAw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.10.4.tgz", + "integrity": "sha512-mohW5q3uAEt8T45YT7Qc5ws6mWgJAaL/8BfWD9Dodo1A3RKWli8wTS+WiQ/knF+tXlPirW/1/MqzzGfCExKECA==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.8.3.tgz", - "integrity": "sha512-f+tF/8UVPU86TrCb06JoPWIdDpTNSGGcAtaD9mLP0aYGA0OS0j7j7DHJR0GTFrUZPUU6loZhbsVZgTh0N+Qdnw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.10.4.tgz", + "integrity": "sha512-V6LuOnD31kTkxQPhKiVYzYC/Jgdq53irJC/xBSmqcNcqFGV+PER4l6rU5SH2Vl7bH9mLDHcc0+l9HUOe4RNGKA==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.3" + "@babel/helper-create-regexp-features-plugin": "^7.10.4" } }, "@babel/plugin-transform-new-target": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.8.3.tgz", - "integrity": "sha512-QuSGysibQpyxexRyui2vca+Cmbljo8bcRckgzYV4kRIsHpVeyeC3JDO63pY+xFZ6bWOBn7pfKZTqV4o/ix9sFw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.10.4.tgz", + "integrity": "sha512-YXwWUDAH/J6dlfwqlWsztI2Puz1NtUAubXhOPLQ5gjR/qmQ5U96DY4FQO8At33JN4XPBhrjB8I4eMmLROjjLjw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-object-assign": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.8.3.tgz", - "integrity": "sha512-i3LuN8tPDqUCRFu3dkzF2r1Nx0jp4scxtm7JxtIqI9he9Vk20YD+/zshdzR9JLsoBMlJlNR82a62vQExNEVx/Q==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.10.4.tgz", + "integrity": "sha512-6zccDhYEICfMeQqIjuY5G09/yhKzG30DKHJeYBQUHIsJH7c2jXSGvgwRalufLAXAq432OSlsEfAOLlzEsQzxVw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-object-super": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.8.3.tgz", - "integrity": "sha512-57FXk+gItG/GejofIyLIgBKTas4+pEU47IXKDBWFTxdPd7F80H8zybyAY7UoblVfBhBGs2EKM+bJUu2+iUYPDQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.10.4.tgz", + "integrity": "sha512-5iTw0JkdRdJvr7sY0vHqTpnruUpTea32JHmq/atIWqsnNussbRzjEDyWep8UNztt1B5IusBYg8Irb0bLbiEBCQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4" } }, "@babel/plugin-transform-parameters": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.8.4.tgz", - "integrity": "sha512-IsS3oTxeTsZlE5KqzTbcC2sV0P9pXdec53SU+Yxv7o/6dvGM5AkTotQKhoSffhNgZ/dftsSiOoxy7evCYJXzVA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.10.4.tgz", + "integrity": "sha512-RurVtZ/D5nYfEg0iVERXYKEgDFeesHrHfx8RT05Sq57ucj2eOYAP6eu5fynL4Adju4I/mP/I6SO0DqNWAXjfLQ==", "dev": true, "requires": { - "@babel/helper-call-delegate": "^7.8.3", - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - }, - "dependencies": { - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-property-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.8.3.tgz", - "integrity": "sha512-uGiiXAZMqEoQhRWMK17VospMZh5sXWg+dlh2soffpkAl96KAm+WZuJfa6lcELotSRmooLqg0MWdH6UUq85nmmg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.10.4.tgz", + "integrity": "sha512-ofsAcKiUxQ8TY4sScgsGeR2vJIsfrzqvFb9GvJ5UdXDzl+MyYCaBj/FGzXuv7qE0aJcjWMILny1epqelnFlz8g==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-regenerator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.8.3.tgz", - "integrity": "sha512-qt/kcur/FxrQrzFR432FGZznkVAjiyFtCOANjkAKwCbt465L6ZCiUQh2oMYGU3Wo8LRFJxNDFwWn106S5wVUNA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.10.4.tgz", + "integrity": "sha512-3thAHwtor39A7C04XucbMg17RcZ3Qppfxr22wYzZNcVIkPHfpM9J0SO8zuCV6SZa265kxBJSrfKTvDCYqBFXGw==", "dev": true, "requires": { - "regenerator-transform": "^0.14.0" + "regenerator-transform": "^0.14.2" } }, "@babel/plugin-transform-reserved-words": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.8.3.tgz", - "integrity": "sha512-mwMxcycN3omKFDjDQUl+8zyMsBfjRFr0Zn/64I41pmjv4NJuqcYlEtezwYtw9TFd9WR1vN5kiM+O0gMZzO6L0A==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.10.4.tgz", + "integrity": "sha512-hGsw1O6Rew1fkFbDImZIEqA8GoidwTAilwCyWqLBM9f+e/u/sQMQu7uX6dyokfOayRuuVfKOW4O7HvaBWM+JlQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-shorthand-properties": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.8.3.tgz", - "integrity": "sha512-I9DI6Odg0JJwxCHzbzW08ggMdCezoWcuQRz3ptdudgwaHxTjxw5HgdFJmZIkIMlRymL6YiZcped4TTCB0JcC8w==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.10.4.tgz", + "integrity": "sha512-AC2K/t7o07KeTIxMoHneyX90v3zkm5cjHJEokrPEAGEy3UCp8sLKfnfOIGdZ194fyN4wfX/zZUWT9trJZ0qc+Q==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.8.3.tgz", - "integrity": "sha512-CkuTU9mbmAoFOI1tklFWYYbzX5qCIZVXPVy0jpXgGwkplCndQAa58s2jr66fTeQnA64bDox0HL4U56CFYoyC7g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.10.4.tgz", + "integrity": "sha512-1e/51G/Ni+7uH5gktbWv+eCED9pP8ZpRhZB3jOaI3mmzfvJTWHkuyYTv0Z5PYtyM+Tr2Ccr9kUdQxn60fI5WuQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-sticky-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.8.3.tgz", - "integrity": "sha512-9Spq0vGCD5Bb4Z/ZXXSK5wbbLFMG085qd2vhL1JYu1WcQ5bXqZBAYRzU1d+p79GcHs2szYv5pVQCX13QgldaWw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.10.4.tgz", + "integrity": "sha512-Ddy3QZfIbEV0VYcVtFDCjeE4xwVTJWTmUtorAJkn6u/92Z/nWJNV+mILyqHKrUxXYKA2EoCilgoPePymKL4DvQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-regex": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-regex": "^7.10.4" } }, "@babel/plugin-transform-template-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.8.3.tgz", - "integrity": "sha512-820QBtykIQOLFT8NZOcTRJ1UNuztIELe4p9DCgvj4NK+PwluSJ49we7s9FB1HIGNIYT7wFUJ0ar2QpCDj0escQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.10.4.tgz", + "integrity": "sha512-4NErciJkAYe+xI5cqfS8pV/0ntlY5N5Ske/4ImxAVX7mk9Rxt2bwDTGv1Msc2BRJvWQcmYEC+yoMLdX22aE4VQ==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-typeof-symbol": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.4.tgz", - "integrity": "sha512-2QKyfjGdvuNfHsb7qnBBlKclbD4CfshH2KvDabiijLMGXPHJXGxtDzwIF7bQP+T0ysw8fYTtxPafgfs/c1Lrqg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.10.4.tgz", + "integrity": "sha512-QqNgYwuuW0y0H+kUE/GWSR45t/ccRhe14Fs/4ZRouNNQsyd4o3PG4OtHiIrepbM2WKUBDAXKCAK/Lk4VhzTaGA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-unicode-escapes": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.10.4.tgz", + "integrity": "sha512-y5XJ9waMti2J+e7ij20e+aH+fho7Wb7W8rNuu72aKRwCHFqQdhkdU2lo3uZ9tQuboEJcUFayXdARhcxLQ3+6Fg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-unicode-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.8.3.tgz", - "integrity": "sha512-+ufgJjYdmWfSQ+6NS9VGUR2ns8cjJjYbrbi11mZBTaWm+Fui/ncTLFF28Ei1okavY+xkojGr1eJxNsWYeA5aZw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.10.4.tgz", + "integrity": "sha512-wNfsc4s8N2qnIwpO/WP2ZiSyjfpTamT2C9V9FDH/Ljub9zw6P3SjkXcFmc0RQUt96k2fmIvtla2MMjgTwIAC+A==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-create-regexp-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/preset-env": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.8.4.tgz", - "integrity": "sha512-HihCgpr45AnSOHRbS5cWNTINs0TwaR8BS8xIIH+QwiW8cKL0llV91njQMpeMReEPVs+1Ao0x3RLEBLtt1hOq4w==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.8.4", - "@babel/helper-compilation-targets": "^7.8.4", - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-proposal-async-generator-functions": "^7.8.3", - "@babel/plugin-proposal-dynamic-import": "^7.8.3", - "@babel/plugin-proposal-json-strings": "^7.8.3", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-proposal-object-rest-spread": "^7.8.3", - "@babel/plugin-proposal-optional-catch-binding": "^7.8.3", - "@babel/plugin-proposal-optional-chaining": "^7.8.3", - "@babel/plugin-proposal-unicode-property-regex": "^7.8.3", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.10.4.tgz", + "integrity": "sha512-tcmuQ6vupfMZPrLrc38d0sF2OjLT3/bZ0dry5HchNCQbrokoQi4reXqclvkkAT5b+gWc23meVWpve5P/7+w/zw==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.10.4", + "@babel/helper-compilation-targets": "^7.10.4", + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-proposal-async-generator-functions": "^7.10.4", + "@babel/plugin-proposal-class-properties": "^7.10.4", + "@babel/plugin-proposal-dynamic-import": "^7.10.4", + "@babel/plugin-proposal-json-strings": "^7.10.4", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4", + "@babel/plugin-proposal-numeric-separator": "^7.10.4", + "@babel/plugin-proposal-object-rest-spread": "^7.10.4", + "@babel/plugin-proposal-optional-catch-binding": "^7.10.4", + "@babel/plugin-proposal-optional-chaining": "^7.10.4", + "@babel/plugin-proposal-private-methods": "^7.10.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.10.4", "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-class-properties": "^7.10.4", "@babel/plugin-syntax-dynamic-import": "^7.8.0", "@babel/plugin-syntax-json-strings": "^7.8.0", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", "@babel/plugin-syntax-object-rest-spread": "^7.8.0", "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", "@babel/plugin-syntax-optional-chaining": "^7.8.0", - "@babel/plugin-syntax-top-level-await": "^7.8.3", - "@babel/plugin-transform-arrow-functions": "^7.8.3", - "@babel/plugin-transform-async-to-generator": "^7.8.3", - "@babel/plugin-transform-block-scoped-functions": "^7.8.3", - "@babel/plugin-transform-block-scoping": "^7.8.3", - "@babel/plugin-transform-classes": "^7.8.3", - "@babel/plugin-transform-computed-properties": "^7.8.3", - "@babel/plugin-transform-destructuring": "^7.8.3", - "@babel/plugin-transform-dotall-regex": "^7.8.3", - "@babel/plugin-transform-duplicate-keys": "^7.8.3", - "@babel/plugin-transform-exponentiation-operator": "^7.8.3", - "@babel/plugin-transform-for-of": "^7.8.4", - "@babel/plugin-transform-function-name": "^7.8.3", - "@babel/plugin-transform-literals": "^7.8.3", - "@babel/plugin-transform-member-expression-literals": "^7.8.3", - "@babel/plugin-transform-modules-amd": "^7.8.3", - "@babel/plugin-transform-modules-commonjs": "^7.8.3", - "@babel/plugin-transform-modules-systemjs": "^7.8.3", - "@babel/plugin-transform-modules-umd": "^7.8.3", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3", - "@babel/plugin-transform-new-target": "^7.8.3", - "@babel/plugin-transform-object-super": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.8.4", - "@babel/plugin-transform-property-literals": "^7.8.3", - "@babel/plugin-transform-regenerator": "^7.8.3", - "@babel/plugin-transform-reserved-words": "^7.8.3", - "@babel/plugin-transform-shorthand-properties": "^7.8.3", - "@babel/plugin-transform-spread": "^7.8.3", - "@babel/plugin-transform-sticky-regex": "^7.8.3", - "@babel/plugin-transform-template-literals": "^7.8.3", - "@babel/plugin-transform-typeof-symbol": "^7.8.4", - "@babel/plugin-transform-unicode-regex": "^7.8.3", - "@babel/types": "^7.8.3", - "browserslist": "^4.8.5", + "@babel/plugin-syntax-top-level-await": "^7.10.4", + "@babel/plugin-transform-arrow-functions": "^7.10.4", + "@babel/plugin-transform-async-to-generator": "^7.10.4", + "@babel/plugin-transform-block-scoped-functions": "^7.10.4", + "@babel/plugin-transform-block-scoping": "^7.10.4", + "@babel/plugin-transform-classes": "^7.10.4", + "@babel/plugin-transform-computed-properties": "^7.10.4", + "@babel/plugin-transform-destructuring": "^7.10.4", + "@babel/plugin-transform-dotall-regex": "^7.10.4", + "@babel/plugin-transform-duplicate-keys": "^7.10.4", + "@babel/plugin-transform-exponentiation-operator": "^7.10.4", + "@babel/plugin-transform-for-of": "^7.10.4", + "@babel/plugin-transform-function-name": "^7.10.4", + "@babel/plugin-transform-literals": "^7.10.4", + "@babel/plugin-transform-member-expression-literals": "^7.10.4", + "@babel/plugin-transform-modules-amd": "^7.10.4", + "@babel/plugin-transform-modules-commonjs": "^7.10.4", + "@babel/plugin-transform-modules-systemjs": "^7.10.4", + "@babel/plugin-transform-modules-umd": "^7.10.4", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.10.4", + "@babel/plugin-transform-new-target": "^7.10.4", + "@babel/plugin-transform-object-super": "^7.10.4", + "@babel/plugin-transform-parameters": "^7.10.4", + "@babel/plugin-transform-property-literals": "^7.10.4", + "@babel/plugin-transform-regenerator": "^7.10.4", + "@babel/plugin-transform-reserved-words": "^7.10.4", + "@babel/plugin-transform-shorthand-properties": "^7.10.4", + "@babel/plugin-transform-spread": "^7.10.4", + "@babel/plugin-transform-sticky-regex": "^7.10.4", + "@babel/plugin-transform-template-literals": "^7.10.4", + "@babel/plugin-transform-typeof-symbol": "^7.10.4", + "@babel/plugin-transform-unicode-escapes": "^7.10.4", + "@babel/plugin-transform-unicode-regex": "^7.10.4", + "@babel/preset-modules": "^0.1.3", + "@babel/types": "^7.10.4", + "browserslist": "^4.12.0", "core-js-compat": "^3.6.2", "invariant": "^2.2.2", "levenary": "^1.1.1", "semver": "^5.5.0" - }, - "dependencies": { - "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } + } + }, + "@babel/preset-modules": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.3.tgz", + "integrity": "sha512-Ra3JXOHBq2xd56xSF7lMKXdjBn3T772Y1Wet3yWnkDly9zHvJki029tAFzvAAK5cf4YV3yoxuP61crYRol6SVg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" } }, "@babel/register": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.8.3.tgz", - "integrity": "sha512-t7UqebaWwo9nXWClIPLPloa5pN33A2leVs8Hf0e9g9YwUP8/H9NeR7DJU+4CXo23QtjChQv5a3DjEtT83ih1rg==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.10.5.tgz", + "integrity": "sha512-eYHdLv43nyvmPn9bfNfrcC4+iYNwdQ8Pxk1MFJuU/U5LpSYl/PH4dFMazCYZDFVi8ueG3shvO+AQfLrxpYulQw==", "dev": true, "requires": { "find-cache-dir": "^2.0.0", - "lodash": "^4.17.13", + "lodash": "^4.17.19", "make-dir": "^2.1.0", "pirates": "^4.0.0", "source-map-support": "^0.5.16" } }, + "@babel/runtime": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.4.tgz", + "integrity": "sha512-UpTN5yUJr9b4EX2CnGNWIvER7Ab83ibv0pcvvHc4UOdrBI5jb8bj+32cCwPX6xu0mt2daFNjYhoi+X7beH0RSw==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, "@babel/template": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", - "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", + "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + } } }, "@babel/traverse": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", - "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.4.tgz", + "integrity": "sha512-aSy7p5THgSYm4YyxNGz6jZpXf+Ok40QF3aA2LyIONkDHpAcJzDUqlCKXv6peqYUs2gmic849C/t2HKw2a2K20Q==", "dev": true, "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4", + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.4", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + } } }, "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", "dev": true, "requires": { - "esutils": "^2.0.2", + "@babel/helper-validator-identifier": "^7.10.4", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + } } }, "@istanbuljs/load-nyc-config": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz", - "integrity": "sha512-ZR0rq/f/E4f4XcgnDvtMWXCUJpi8eO0rssVhmztsZqLIEFA9UUP9zmpE0VxlM+kv/E1ul2I876Fwil2ayptDVg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "requires": { "camelcase": "^5.3.1", "find-up": "^4.1.0", + "get-package-type": "^0.1.0", "js-yaml": "^3.13.1", "resolve-from": "^5.0.0" }, @@ -2131,6 +1176,15 @@ "p-locate": "^4.1.0" } }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, "p-locate": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", @@ -2140,16 +1194,16 @@ "p-limit": "^2.2.0" } }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true } } @@ -2161,31 +1215,37 @@ "dev": true }, "@nodelib/fs.scandir": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.2.tgz", - "integrity": "sha512-wrIBsjA5pl13f0RN4Zx4FNWmU71lv03meGKnqRUoCyan17s4V3WL92f3w3AIuWbNnpcrQyFBU5qMavJoB8d27w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", "dev": true, "requires": { - "@nodelib/fs.stat": "2.0.2", + "@nodelib/fs.stat": "2.0.3", "run-parallel": "^1.1.9" } }, "@nodelib/fs.stat": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.2.tgz", - "integrity": "sha512-z8+wGWV2dgUhLqrtRYa03yDx4HWMvXKi1z8g3m2JyxAx8F7xk74asqPk5LAETjqDSGLFML/6CDl0+yFunSYicw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", "dev": true }, "@nodelib/fs.walk": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.3.tgz", - "integrity": "sha512-l6t8xEhfK9Sa4YO5mIRdau7XSOADfmh3jCr0evNHdY+HNkW6xuQhgMH7D73VV6WpZOagrW0UludvMTiifiwTfA==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", "dev": true, "requires": { - "@nodelib/fs.scandir": "2.1.2", + "@nodelib/fs.scandir": "2.1.3", "fastq": "^1.6.0" } }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true + }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -2216,184 +1276,183 @@ "dev": true }, "@types/node": { - "version": "12.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz", - "integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w==", + "version": "13.13.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.5.tgz", + "integrity": "sha512-3ySmiBYJPqgjiHA7oEaIo2Rzz0HrOZ7yrNO5HWyaE5q0lQ3BppDZ3N53Miz8bw2I7gh1/zir2MGVZBvpb1zq9g==", "dev": true }, "@webassemblyjs/ast": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", - "integrity": "sha512-aJMfngIZ65+t71C3y2nBBg5FFG0Okt9m0XEgWZ7Ywgn1oMAT8cNwx00Uv1cQyHtidq0Xn94R4TAywO+LCQ+ZAQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", + "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", "dev": true, "requires": { - "@webassemblyjs/helper-module-context": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/wast-parser": "1.8.5" + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0" } }, "@webassemblyjs/floating-point-hex-parser": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz", - "integrity": "sha512-9p+79WHru1oqBh9ewP9zW95E3XAo+90oth7S5Re3eQnECGq59ly1Ri5tsIipKGpiStHsUYmY3zMLqtk3gTcOtQ==", + "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==", "dev": true }, "@webassemblyjs/helper-api-error": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz", - "integrity": "sha512-Za/tnzsvnqdaSPOUXHyKJ2XI7PDX64kWtURyGiJJZKVEdFOsdKUCPTNEVFZq3zJ2R0G5wc2PZ5gvdTRFgm81zA==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", + "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", "dev": true }, "@webassemblyjs/helper-buffer": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz", - "integrity": "sha512-Ri2R8nOS0U6G49Q86goFIPNgjyl6+oE1abW1pS84BuhP1Qcr5JqMwRFT3Ah3ADDDYGEgGs1iyb1DGX+kAi/c/Q==", + "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.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz", - "integrity": "sha512-VQAadSubZIhNpH46IR3yWO4kZZjMxN1opDrzePLdVKAZ+DFjkGD/rf4v1jap744uPVU6yjL/smZbRIIJTOUnKQ==", + "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.8.5" + "@webassemblyjs/wast-printer": "1.9.0" } }, "@webassemblyjs/helper-fsm": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz", - "integrity": "sha512-kRuX/saORcg8se/ft6Q2UbRpZwP4y7YrWsLXPbbmtepKr22i8Z4O3V5QE9DbZK908dh5Xya4Un57SDIKwB9eow==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", + "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", "dev": true }, "@webassemblyjs/helper-module-context": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz", - "integrity": "sha512-/O1B236mN7UNEU4t9X7Pj38i4VoU8CcMHyy3l2cV/kIF4U5KoHXDVqcDuOs1ltkac90IM4vZdHc52t1x8Yfs3g==", + "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==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "mamacro": "^0.0.3" + "@webassemblyjs/ast": "1.9.0" } }, "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz", - "integrity": "sha512-Cu4YMYG3Ddl72CbmpjU/wbP6SACcOPVbHN1dI4VJNJVgFwaKf1ppeFJrwydOG3NDHxVGuCfPlLZNyEdIYlQ6QQ==", + "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==", "dev": true }, "@webassemblyjs/helper-wasm-section": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz", - "integrity": "sha512-VV083zwR+VTrIWWtgIUpqfvVdK4ff38loRmrdDBgBT8ADXYsEZ5mPQ4Nde90N3UYatHdYoDIFb7oHzMncI02tA==", + "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==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-buffer": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/wasm-gen": "1.8.5" + "@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/ieee754": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz", - "integrity": "sha512-aaCvQYrvKbY/n6wKHb/ylAJr27GglahUO89CcGXMItrOBqRarUMxWLJgxm9PJNuKULwN5n1csT9bYoMeZOGF3g==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", + "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", "dev": true, "requires": { "@xtuc/ieee754": "^1.2.0" } }, "@webassemblyjs/leb128": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.8.5.tgz", - "integrity": "sha512-plYUuUwleLIziknvlP8VpTgO4kqNaH57Y3JnNa6DLpu/sGcP6hbVdfdX5aHAV716pQBKrfuU26BJK29qY37J7A==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", + "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", "dev": true, "requires": { "@xtuc/long": "4.2.2" } }, "@webassemblyjs/utf8": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.8.5.tgz", - "integrity": "sha512-U7zgftmQriw37tfD934UNInokz6yTmn29inT2cAetAsaU9YeVCveWEwhKL1Mg4yS7q//NGdzy79nlXh3bT8Kjw==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", + "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", "dev": true }, "@webassemblyjs/wasm-edit": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz", - "integrity": "sha512-A41EMy8MWw5yvqj7MQzkDjU29K7UJq1VrX2vWLzfpRHt3ISftOXqrtojn7nlPsZ9Ijhp5NwuODuycSvfAO/26Q==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", + "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-buffer": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/helper-wasm-section": "1.8.5", - "@webassemblyjs/wasm-gen": "1.8.5", - "@webassemblyjs/wasm-opt": "1.8.5", - "@webassemblyjs/wasm-parser": "1.8.5", - "@webassemblyjs/wast-printer": "1.8.5" + "@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/wasm-gen": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz", - "integrity": "sha512-BCZBT0LURC0CXDzj5FXSc2FPTsxwp3nWcqXQdOZE4U7h7i8FqtFK5Egia6f9raQLpEKT1VL7zr4r3+QX6zArWg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", + "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/ieee754": "1.8.5", - "@webassemblyjs/leb128": "1.8.5", - "@webassemblyjs/utf8": "1.8.5" + "@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/wasm-opt": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz", - "integrity": "sha512-HKo2mO/Uh9A6ojzu7cjslGaHaUU14LdLbGEKqTR7PBKwT6LdPtLLh9fPY33rmr5wcOMrsWDbbdCHq4hQUdd37Q==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", + "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-buffer": "1.8.5", - "@webassemblyjs/wasm-gen": "1.8.5", - "@webassemblyjs/wasm-parser": "1.8.5" + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0" } }, "@webassemblyjs/wasm-parser": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz", - "integrity": "sha512-pi0SYE9T6tfcMkthwcgCpL0cM9nRYr6/6fjgDtL6q/ZqKHdMWvxitRi5JcZ7RI4SNJJYnYNaWy5UUrHQy998lw==", + "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.8.5", - "@webassemblyjs/helper-api-error": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/ieee754": "1.8.5", - "@webassemblyjs/leb128": "1.8.5", - "@webassemblyjs/utf8": "1.8.5" + "@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.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz", - "integrity": "sha512-daXC1FyKWHF1i11obK086QRlsMsY4+tIOKgBqI1lxAnkp9xe9YMcgOxm9kLe+ttjs5aWV2KKE1TWJCN57/Btsg==", + "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==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/floating-point-hex-parser": "1.8.5", - "@webassemblyjs/helper-api-error": "1.8.5", - "@webassemblyjs/helper-code-frame": "1.8.5", - "@webassemblyjs/helper-fsm": "1.8.5", + "@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/wast-printer": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz", - "integrity": "sha512-w0U0pD4EhlnvRyeJzBqaVSJAo9w/ce7/WPogeXLzGkO6hzhr4GnQIZ4W4uUt5b9ooAaXPtnXlj0gzsXEOUNYMg==", + "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==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/wast-parser": "1.8.5", + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0", "@xtuc/long": "4.2.2" } }, @@ -2426,15 +1485,15 @@ } }, "acorn": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.0.0.tgz", - "integrity": "sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.2.0.tgz", + "integrity": "sha512-apwXVmYVpQ34m/i71vrApRrRKCWQnZZF1+npOD0WV5xZFfwWOmKGQ2RWlfdy9vWITsenisM8M0Qeq8agcFHNiQ==", "dev": true }, "acorn-jsx": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.2.tgz", - "integrity": "sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", "dev": true }, "after": { @@ -2444,31 +1503,31 @@ "dev": true }, "agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.1.tgz", + "integrity": "sha512-01q25QQDwLSsyfhrKbn8yuur+JNw0H+0Y4JiGIKd3z9aYk/w/2kxD/Upc+t2ZBBSUNff50VjPsSW2YxM8QYKVg==", "dev": true, "requires": { - "es6-promisify": "^5.0.0" + "debug": "4" } }, "aggregate-error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.0.tgz", - "integrity": "sha512-yKD9kEoJIR+2IFqhMwayIBgheLYbB3PS2OBhWae1L/ODTd/JF/30cW0bc9TqzRL3k4U41Dieu3BF4I29p8xesA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", "dev": true, "requires": { "clean-stack": "^2.0.0", - "indent-string": "^3.2.0" + "indent-string": "^4.0.0" } }, "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", "dev": true, "requires": { - "fast-deep-equal": "^2.0.1", + "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" @@ -2503,10 +1562,21 @@ } }, "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } }, "ansi-gray": { "version": "0.1.1", @@ -2741,13 +1811,14 @@ "dev": true }, "array-includes": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", - "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", + "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.7.0" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "is-string": "^1.0.5" } }, "array-initial": { @@ -2822,6 +1893,18 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, + "array.prototype.map": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz", + "integrity": "sha512-Az3OYxgsa1g7xDYp86l0nnN4bcmuEITGe1rbdEBVkrqkzMgDcbdQ2R7r41pNzti+4NMces3H8gMmuioZUilLgw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.4" + } + }, "arraybuffer.slice": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", @@ -2837,6 +1920,14 @@ "bn.js": "^4.0.0", "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } } }, "assert": { @@ -2924,38 +2015,33 @@ "dev": true }, "babel-loader": { - "version": "8.0.6", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.6.tgz", - "integrity": "sha512-4BmWKtBOBm13uoUwd08UwjZlaw3O9GWf456R9j+5YykFZ6LUIjIKLc0zEZf+hauxPOJs96C8k6FvYD09vWzhYw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.1.0.tgz", + "integrity": "sha512-7q7nC1tYOrqvUrN3LQK4GwSk/TQorZSOlO9C+RZDZpODgyN4ZlCqE5q9cDsyWOliN+aU9B4JX01xK9eJXowJLw==", "dev": true, "requires": { - "find-cache-dir": "^2.0.0", - "loader-utils": "^1.0.2", - "mkdirp": "^0.5.1", - "pify": "^4.0.1" + "find-cache-dir": "^2.1.0", + "loader-utils": "^1.4.0", + "mkdirp": "^0.5.3", + "pify": "^4.0.1", + "schema-utils": "^2.6.5" }, "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" } } } }, "babel-plugin-dynamic-import-node": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz", - "integrity": "sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", "dev": true, "requires": { "object.assign": "^4.1.0" @@ -3058,9 +2144,9 @@ "dev": true }, "base64id": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz", - "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", "dev": true }, "benchmark": { @@ -3094,6 +2180,16 @@ "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", "dev": true }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "bit-twiddle": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bit-twiddle/-/bit-twiddle-1.0.2.tgz", @@ -3107,15 +2203,15 @@ "dev": true }, "bluebird": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", - "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==", + "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": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz", + "integrity": "sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==", "dev": true }, "body-parser": { @@ -3229,21 +2325,50 @@ "requires": { "bn.js": "^4.1.0", "randombytes": "^2.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } } }, "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.0.tgz", + "integrity": "sha512-hEZC1KEeYuoHRqhGhTy6gWrpJA3ZDjFWv0DE61643ZnOXAKJb3u7yWcrU0mMc9SwAqK1n7myPGndkp0dFG7NFA==", "dev": true, "requires": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.2", + "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": { @@ -3256,14 +2381,15 @@ } }, "browserslist": { - "version": "4.8.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.6.tgz", - "integrity": "sha512-ZHao85gf0eZ0ESxLfCp73GG9O/VTytYDIkIiZDlURppLTI9wErSM/5yAKEq6rcUdxBLjMELmrYUJGg5sxGKMHg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.13.0.tgz", + "integrity": "sha512-MINatJ5ZNrLnQ6blGvePd/QOz9Xtu+Ne+x29iQSCHfkU5BugKVJwZKn/iiL8UbpIpa3JhviKjz+XxMo0m2caFQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001023", - "electron-to-chromium": "^1.3.341", - "node-releases": "^1.1.47" + "caniuse-lite": "^1.0.30001093", + "electron-to-chromium": "^1.3.488", + "escalade": "^3.0.1", + "node-releases": "^1.1.58" } }, "browserstack": { @@ -3273,17 +2399,47 @@ "dev": true, "requires": { "https-proxy-agent": "^2.2.1" + }, + "dependencies": { + "agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "dev": true, + "requires": { + "es6-promisify": "^5.0.0" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "https-proxy-agent": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", + "dev": true, + "requires": { + "agent-base": "^4.3.0", + "debug": "^3.1.0" + } + } } }, "browserstack-local": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/browserstack-local/-/browserstack-local-1.4.2.tgz", - "integrity": "sha512-fRaynjF0MvtyyfPRy2NFnVwxLyNtD28K/v9xRsIjUVf7xLc80NIm7Nfr3KXlFmWizhG91PL/UAOXlHkoxQjaNw==", + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/browserstack-local/-/browserstack-local-1.4.5.tgz", + "integrity": "sha512-0/VdSv2YVXmcnwBb64XThMvjM1HnZJnPdv7CUgQbC5y/N9Wsr0Fu+j1oknE9fC/VPx9CpoSC6CJ0kza42skMSA==", "dev": true, "requires": { - "https-proxy-agent": "^2.2.1", - "is-running": "^2.0.0", - "ps-tree": "=1.1.1", + "https-proxy-agent": "^4.0.0", + "is-running": "^2.1.0", + "ps-tree": "=1.2.0", "temp-fs": "^0.9.9" } }, @@ -3298,34 +2454,12 @@ "isarray": "^1.0.0" } }, - "buffer-alloc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", - "dev": true, - "requires": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" - } - }, - "buffer-alloc-unsafe": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", - "dev": true - }, "buffer-equal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", "dev": true }, - "buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", - "dev": true - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -3351,9 +2485,9 @@ "dev": true }, "cacache": { - "version": "12.0.3", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.3.tgz", - "integrity": "sha512-kqdmfXEGFepesTuROHMs3MpFLWrPkSSpRqOw80RCflZXy/khxaArvFrQ7uJxSUduzAufc6G0g1VUCOZXxWavPw==", + "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", @@ -3373,28 +2507,22 @@ "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==", + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "yallist": "^3.0.2" + "minimist": "^1.2.5" } }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "requires": { - "minimist": "0.0.8" + "glob": "^7.1.3" } }, "y18n": { @@ -3402,12 +2530,6 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true } } }, @@ -3441,9 +2563,9 @@ }, "dependencies": { "make-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", - "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { "semver": "^6.0.0" @@ -3476,9 +2598,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001023", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001023.tgz", - "integrity": "sha512-C5TDMiYG11EOhVOA62W1p3UsJ2z4DsHtMBQtjzp3ZsUglcQn62WOUgW0y795c7A5uZ+GCEIvzkMatLIlAsbNTA==", + "version": "1.0.30001097", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001097.tgz", + "integrity": "sha512-TeuSleKt/vWXaPkLVFqGDnbweYfq4IaZ6rUugFf3rWY6dlII8StUZ8Ddin0PkADfgYZ4wRqCdO2ORl4Rn5eZIA==", "dev": true }, "chalk": { @@ -3499,9 +2621,9 @@ "dev": true }, "chokidar": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", - "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", "dev": true, "requires": { "anymatch": "^2.0.0", @@ -3615,9 +2737,9 @@ } }, "chownr": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.3.tgz", - "integrity": "sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==", + "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": { @@ -3669,18 +2791,18 @@ "dev": true }, "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "requires": { - "restore-cursor": "^2.0.0" + "restore-cursor": "^3.1.0" } }, "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", "dev": true }, "cliui": { @@ -3741,9 +2863,9 @@ "dev": true }, "codecov": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.6.5.tgz", - "integrity": "sha512-v48WuDMUug6JXwmmfsMzhCHRnhUf8O3duqXvltaYJKrO1OekZWpB/eH6iIoaxMl8Qli0+u3OxptdsBOYiD7VAQ==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.7.2.tgz", + "integrity": "sha512-fmCjAkTese29DUX3GMIi4EaKGflHa4K51EoMc29g8fBHawdk/+KEq5CWOeXLdd9+AT7o1wO4DIpp/Z1KCqCz1g==", "dev": true, "requires": { "argv": "0.0.2", @@ -3908,9 +3030,9 @@ "dev": true }, "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", "dev": true, "requires": { "safe-buffer": "~5.1.1" @@ -3936,19 +3058,22 @@ "run-queue": "^1.0.0" }, "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "requires": { - "minimist": "0.0.8" + "glob": "^7.1.3" } } } @@ -3970,12 +3095,12 @@ } }, "core-js-compat": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.4.tgz", - "integrity": "sha512-zAa3IZPvsJ0slViBQ2z+vgyyTuhd3MFn1rBQjZSKVEgB0UMYhUkCj9jJUVPgGTGqWvsBVmfnruXgTcNyTlEiSA==", + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz", + "integrity": "sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==", "dev": true, "requires": { - "browserslist": "^4.8.3", + "browserslist": "^4.8.5", "semver": "7.0.0" }, "dependencies": { @@ -4001,6 +3126,14 @@ "requires": { "bn.js": "^4.1.0", "elliptic": "^6.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } } }, "create-hash": { @@ -4031,16 +3164,25 @@ } }, "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } } }, "crypto-browserify": { @@ -4094,9 +3236,9 @@ } }, "date-format": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.1.0.tgz", - "integrity": "sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-3.0.0.tgz", + "integrity": "sha512-eyTcpKOcamdhWJXj56DpQMo1ylSQpcGtGKXcU0Tb97+K56/CF5amAqqqNj0+KvA0iw2ynxtHWFsPDSClCxe48w==", "dev": true }, "debug": { @@ -4255,17 +3397,6 @@ "p-map": "^3.0.0", "rimraf": "^3.0.0", "slash": "^3.0.0" - }, - "dependencies": { - "rimraf": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", - "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } } }, "depd": { @@ -4297,9 +3428,9 @@ "dev": true }, "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, "diffie-hellman": { @@ -4311,6 +3442,14 @@ "bn.js": "^4.1.0", "miller-rabin": "^4.0.0", "randombytes": "^2.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } } }, "dir-glob": { @@ -4390,15 +3529,15 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.344", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.344.tgz", - "integrity": "sha512-tvbx2Wl8WBR+ym3u492D0L6/jH+8NoQXqe46+QhbWH3voVPauGuZYeb1QAXYoOAWuiP2dbSvlBx0kQ1F3hu/Mw==", + "version": "1.3.496", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.496.tgz", + "integrity": "sha512-TXY4mwoyowwi4Lsrq9vcTUYBThyc1b2hXaTZI13p8/FRhY2CTaq5lK+DVjhYkKiTLsKt569Xes+0J5JsVXFurQ==", "dev": true }, "elliptic": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", - "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", "dev": true, "requires": { "bn.js": "^4.4.0", @@ -4408,18 +3547,26 @@ "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0", "minimalistic-crypto-utils": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } } }, "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "emojis-list": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", - "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true }, "encodeurl": { @@ -4429,91 +3576,62 @@ "dev": true }, "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, "requires": { "once": "^1.4.0" } }, "engine.io": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.2.1.tgz", - "integrity": "sha512-+VlKzHzMhaU+GsCIg4AoXF1UdDFjHHwMmMKqMJNDNLlUlejz58FCy4LBqB2YVJskHGYl06BatYWKP2TVdVXE5w==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.4.2.tgz", + "integrity": "sha512-b4Q85dFkGw+TqgytGPrGgACRUhsdKc9S9ErRAXpPGy/CXKs4tYoHDkvIRdsseAF7NjfVwjRFIn6KTnbw7LwJZg==", "dev": true, "requires": { "accepts": "~1.3.4", - "base64id": "1.0.0", + "base64id": "2.0.0", "cookie": "0.3.1", - "debug": "~3.1.0", - "engine.io-parser": "~2.1.0", - "ws": "~3.3.1" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } + "debug": "~4.1.0", + "engine.io-parser": "~2.2.0", + "ws": "^7.1.2" } }, "engine.io-client": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.2.1.tgz", - "integrity": "sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.3.tgz", + "integrity": "sha512-0NGY+9hioejTEJCaSJZfWZLk4FPI9dN+1H1C4+wj2iuFba47UgZbJzfWs4aNFajnX/qAaYKbe2lLTfEEWzCmcw==", "dev": true, "requires": { - "component-emitter": "1.2.1", + "component-emitter": "~1.3.0", "component-inherit": "0.0.3", - "debug": "~3.1.0", - "engine.io-parser": "~2.1.1", + "debug": "~4.1.0", + "engine.io-parser": "~2.2.0", "has-cors": "1.1.0", "indexof": "0.0.1", "parseqs": "0.0.5", "parseuri": "0.0.5", - "ws": "~3.3.1", + "ws": "~6.1.0", "xmlhttprequest-ssl": "~1.5.4", "yeast": "0.1.2" }, "dependencies": { - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "ws": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", + "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", "dev": true, "requires": { - "ms": "2.0.0" + "async-limiter": "~1.0.0" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true } } }, "engine.io-parser": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.3.tgz", - "integrity": "sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.0.tgz", + "integrity": "sha512-6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w==", "dev": true, "requires": { "after": "0.8.2", @@ -4524,9 +3642,9 @@ } }, "enhanced-resolve": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.1.tgz", - "integrity": "sha512-98p2zE+rL7/g/DzMHMTF4zZlCgeVdJ7yr6xzEpJRYwFYrGi9ANdn5DnJURg6RpBkyk60XYDnWIv51VfIhfNGuA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz", + "integrity": "sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -4571,39 +3689,73 @@ } }, "es-abstract": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", - "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", "dev": true, "requires": { - "es-to-primitive": "^1.2.0", + "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", - "object-keys": "^1.0.12" + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" } }, - "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "es-array-method-boxes-properly": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", + "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", + "dev": true + }, + "es-get-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz", + "integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==", "dev": true, "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", + "es-abstract": "^1.17.4", + "has-symbols": "^1.0.1", + "is-arguments": "^1.0.4", + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-string": "^1.0.5", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", "is-symbol": "^1.0.2" } }, "es5-ext": { - "version": "0.10.50", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz", - "integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==", + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", "dev": true, "requires": { "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.1", - "next-tick": "^1.0.0" + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" } }, "es6-error": { @@ -4639,13 +3791,13 @@ } }, "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", "dev": true, "requires": { - "d": "1", - "es5-ext": "~0.10.14" + "d": "^1.0.1", + "ext": "^1.1.2" } }, "es6-weak-map": { @@ -4660,6 +3812,12 @@ "es6-symbol": "^3.1.1" } }, + "escalade": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.0.1.tgz", + "integrity": "sha512-DR6NO3h9niOT+MZs7bjxlj2a1k+POu5RN8CLTPX2+i78bRi9eLe7+0zXgUHMnGXWybYcL61E9hGhPKqedy8tQA==", + "dev": true + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -4709,9 +3867,9 @@ } }, "eslint": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.4.0.tgz", - "integrity": "sha512-WTVEzK3lSFoXUovDHEbkJqCVPEPwbhCq4trDktNI6ygs7aO41d4cDT0JFAT5MivzZeVLWlg7vHL+bgrQv/t3vA==", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -4721,19 +3879,19 @@ "debug": "^4.0.1", "doctrine": "^3.0.0", "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.2", + "eslint-utils": "^1.4.3", "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.1", + "espree": "^6.1.2", "esquery": "^1.0.1", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", "glob-parent": "^5.0.0", - "globals": "^11.7.0", + "globals": "^12.1.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^6.4.1", + "inquirer": "^7.0.0", "is-glob": "^4.0.0", "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", @@ -4742,7 +3900,7 @@ "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", + "optionator": "^0.8.3", "progress": "^2.0.0", "regexpp": "^2.0.1", "semver": "^6.1.2", @@ -4759,33 +3917,78 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" } }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -4796,17 +3999,17 @@ } }, "strip-json-comments": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", - "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", "dev": true } } }, "eslint-config-standard": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.0.tgz", - "integrity": "sha512-EF6XkrrGVbvv8hL/kYa/m6vnvmUT+K82pJJc4JJVMM6+Qgqh0pnwprSxdduDLB9p/7bIxD+YV5O0wfb8lmcPbA==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.1.tgz", + "integrity": "sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg==", "dev": true }, "eslint-config-standard-jsx": { @@ -4816,13 +4019,13 @@ "dev": true }, "eslint-import-resolver-node": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", - "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.3.tgz", + "integrity": "sha512-b8crLDo0M5RSe5YG8Pu2DYBj71tSB6OvXkfzwbJU2w7y8P4/yo0MyF8jU26IEuEuHF2K5/gcAJE3LhQGqBBbVg==", "dev": true, "requires": { "debug": "^2.6.9", - "resolve": "^1.5.0" + "resolve": "^1.13.1" }, "dependencies": { "debug": { @@ -4843,12 +4046,12 @@ } }, "eslint-module-utils": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.1.tgz", - "integrity": "sha512-H6DOj+ejw7Tesdgbfs4jeS4YMFrT8uI8xwd1gtQqXssaR0EQ26L+2O/w6wkYFy2MymON0fTwHmXBvvfLNZVZEw==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", "dev": true, "requires": { - "debug": "^2.6.8", + "debug": "^2.6.9", "pkg-dir": "^2.0.0" }, "dependencies": { @@ -4861,55 +4064,12 @@ "ms": "2.0.0" } }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, "pkg-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", @@ -4932,9 +4092,9 @@ }, "dependencies": { "regexpp": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.0.0.tgz", - "integrity": "sha512-Z+hNr7RAVWxznLPuA7DIh8UNX1j9CDrUQxskw9IrBE1Dxue2lyXT+shqEIeLUjrokxIP8CMy1WkjgG3rTsd5/g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true } } @@ -4977,15 +4137,6 @@ "isarray": "^1.0.0" } }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, "load-json-file": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", @@ -4998,46 +4149,12 @@ "strip-bom": "^3.0.0" } }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, "path-type": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", @@ -5163,12 +4280,12 @@ } }, "eslint-utils": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.2.tgz", - "integrity": "sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", "dev": true, "requires": { - "eslint-visitor-keys": "^1.0.0" + "eslint-visitor-keys": "^1.1.0" } }, "eslint-visitor-keys": { @@ -5178,13 +4295,13 @@ "dev": true }, "espree": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.1.1.tgz", - "integrity": "sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", "dev": true, "requires": { - "acorn": "^7.0.0", - "acorn-jsx": "^5.0.2", + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", "eslint-visitor-keys": "^1.1.0" } }, @@ -5195,18 +4312,18 @@ "dev": true }, "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", "dev": true, "requires": { - "estraverse": "^4.0.0" + "estraverse": "^5.1.0" }, "dependencies": { "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", "dev": true } } @@ -5256,15 +4373,15 @@ } }, "eventemitter3": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.0.tgz", - "integrity": "sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", + "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==", "dev": true }, "events": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.1.0.tgz", - "integrity": "sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", + "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", "dev": true }, "evp_bytestokey": { @@ -5342,6 +4459,23 @@ "integrity": "sha512-4EMSHGOPSwAfBiibw3ndnP0AvjDWLsMvGOvWEZ2F96IGk0bIVdjQisOHxReSkE13mHcfbuCiXw+G4y0zv6N8Eg==", "dev": true }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==", + "dev": true + } + } + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -5458,29 +4592,29 @@ } }, "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", "dev": true }, "fast-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.0.4.tgz", - "integrity": "sha512-wkIbV6qg37xTJwqSsdnIphL1e+LaGz4AIQqr00mIubMaEhv1/HEmJ0uuCGZRNRUkZZmOB5mJKO0ZUTVq+SxMQg==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", + "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", "dev": true, "requires": { - "@nodelib/fs.stat": "^2.0.1", - "@nodelib/fs.walk": "^1.2.1", - "glob-parent": "^5.0.0", - "is-glob": "^4.0.1", - "merge2": "^1.2.3", - "micromatch": "^4.0.2" + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" } }, "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, "fast-levenshtein": { @@ -5490,24 +4624,24 @@ "dev": true }, "fastq": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", - "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.7.0.tgz", + "integrity": "sha512-YOadQRnHd5q6PogvAR/x62BGituF2ufiEA6s8aavQANw5YKHERI4AREboX6KotzP8oX2klxYF2wcV/7bn1clfQ==", "dev": true, "requires": { - "reusify": "^1.0.0" + "reusify": "^1.0.4" } }, "figgy-pudding": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", - "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", "dev": true }, "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "requires": { "escape-string-regexp": "^1.0.5" @@ -5522,6 +4656,13 @@ "flat-cache": "^2.0.1" } }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -5581,12 +4722,12 @@ "dev": true }, "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "locate-path": "^3.0.0" + "locate-path": "^2.0.0" } }, "findup-sync": { @@ -5765,9 +4906,9 @@ } }, "flatted": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", - "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", "dev": true }, "flush-write-stream": { @@ -5781,24 +4922,10 @@ } }, "follow-redirects": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.9.0.tgz", - "integrity": "sha512-CRcPzsSIbXyVDl0QI01muNDu69S8trU4jArW9LpOt2WtC6LyUJetcIrmfHsRBx7/Jb6GHJUiuqyYxPooFfNt6A==", - "dev": true, - "requires": { - "debug": "^3.0.0" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - } - } + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.12.1.tgz", + "integrity": "sha512-tmRv0AVuR7ZyouUHLeNSiO6pqulF7dYa3s19c6t+wz9LD69/uSzdMxJ2S91nTI9U3rt/IldxpzMOFejp6f0hjg==", + "dev": true }, "for-in": { "version": "1.0.2", @@ -5816,679 +4943,99 @@ } }, "foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" - }, - "dependencies": { - "cross-spawn": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", - "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "fraction.js": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.0.12.tgz", - "integrity": "sha512-8Z1K0VTG4hzYY7kA/1sj4/r1/RWLBD3xwReT/RCrUCbzPszjNQCCsy3ktkU/eaEqX3MYa4pY37a52eiBlPMlhA==" - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", - "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" - } - }, - "fromentries": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", - "integrity": "sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ==", - "dev": true - }, - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs-mkdirp-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", - "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "through2": "^2.0.3" - } - }, - "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.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true, - "optional": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^4.1.0", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true, - "dev": true, - "optional": true - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, + "fraction.js": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.0.12.tgz", + "integrity": "sha512-8Z1K0VTG4hzYY7kA/1sj4/r1/RWLBD3xwReT/RCrUCbzPszjNQCCsy3ktkU/eaEqX3MYa4pY37a52eiBlPMlhA==" + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "from": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", + "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" + } + }, + "fromentries": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", + "integrity": "sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ==", + "dev": true + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-mkdirp-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", + "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "through2": "^2.0.3" + } + }, + "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.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "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, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" } }, "function-bind": { @@ -6515,6 +5062,12 @@ "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", "dev": true }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, "get-stdin": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", @@ -6542,9 +5095,9 @@ } }, "glob-parent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz", - "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", "dev": true, "requires": { "is-glob": "^4.0.1" @@ -6634,9 +5187,9 @@ "dev": true }, "globby": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz", - "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==", + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", + "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", "dev": true, "requires": { "@types/glob": "^7.1.1", @@ -6659,9 +5212,9 @@ } }, "graceful-fs": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", - "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, "growl": { @@ -6732,15 +5285,16 @@ } }, "handlebars": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.3.tgz", - "integrity": "sha512-SRGwSYuNfx8DwHD/6InAPzD6RgeruWLT+B8e8a7gGs8FWgHzlExpTFMEq2IA6QpAfOClpKHy6+8IqTjeBCu6Kg==", + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", + "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", "dev": true, "requires": { + "minimist": "^1.2.5", "neo-async": "^2.6.0", - "optimist": "^0.6.1", "source-map": "^0.6.1", - "uglify-js": "^3.1.4" + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" }, "dependencies": { "source-map": { @@ -6790,9 +5344,9 @@ "dev": true }, "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, "has-value": { @@ -6848,13 +5402,33 @@ } }, "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "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.1", - "safe-buffer": "^5.0.1" + "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": { @@ -6868,21 +5442,13 @@ } }, "hasha": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.1.0.tgz", - "integrity": "sha512-OFPDWmzPN1l7atOV1TgBVmNtBxaIysToK6Ve9DK+vT6pYuklw/nPNT+HJbZi0KDcI6vWB+9tgvZ5YD7fA3CXcA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", + "integrity": "sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==", "dev": true, "requires": { "is-stream": "^2.0.0", "type-fest": "^0.8.0" - }, - "dependencies": { - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - } } }, "he": { @@ -6912,15 +5478,15 @@ } }, "hosted-git-info": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.4.tgz", - "integrity": "sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, "html-escaper": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.0.tgz", - "integrity": "sha512-a4u9BeERWGu/S8JiWEAQcdrg9v4QArtP9keViQjGMdff20fBdd8waotXaNmODqBe6uZ3Nafi7K/ho4gCQHV3Ig==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, "http-errors": { @@ -6945,9 +5511,9 @@ } }, "http-proxy": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.0.tgz", - "integrity": "sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ==", + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "dev": true, "requires": { "eventemitter3": "^4.0.0", @@ -6956,24 +5522,14 @@ } }, "http-proxy-agent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.0.tgz", - "integrity": "sha512-GX0FA6+IcDf4Oxc/FBWgYj4zKgo/DnZrksaG9jyuQLExs6xlX+uI5lcA8ymM3JaZTRrF/4s2UX19wJolyo7OBA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", "dev": true, "requires": { + "@tootallnate/once": "1", "agent-base": "6", "debug": "4" - }, - "dependencies": { - "agent-base": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.0.tgz", - "integrity": "sha512-j1Q7cSCqN+AwrmDd+pzgqc0/NpC655x2bUf5ZjRIO77DcNBFmh+OgRNzF6OKdCC9RSCb19fGd99+bhXFdkRNqw==", - "dev": true, - "requires": { - "debug": "4" - } - } } }, "https-browserify": { @@ -6983,23 +5539,20 @@ "dev": true }, "https-proxy-agent": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.3.tgz", - "integrity": "sha512-Ytgnz23gm2DVftnzqRRz2dOXZbGd2uiajSw/95bPp6v53zPRspQjLm/AfBgqbJ2qfeRXWIOMVLpp86+/5yX39Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", + "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", "dev": true, "requires": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" + "agent-base": "5", + "debug": "4" }, "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } + "agent-base": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", + "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==", + "dev": true } } }, @@ -7040,13 +5593,21 @@ } }, "import-fresh": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", - "integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", "dev": true, "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } } }, "imurmurhash": { @@ -7056,9 +5617,9 @@ "dev": true }, "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, "indexof": { @@ -7096,74 +5657,106 @@ "dev": true }, "inquirer": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", - "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", "dev": true, "requires": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", "cli-width": "^2.0.0", "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", "through": "^2.3.6" }, "dependencies": { "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "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 + }, + "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 }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - } + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" } } } @@ -7225,6 +5818,12 @@ } } }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -7247,9 +5846,9 @@ "dev": true }, "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", "dev": true }, "is-data-descriptor": { @@ -7273,9 +5872,9 @@ } }, "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, "is-descriptor": { @@ -7297,6 +5896,12 @@ } } }, + "is-docker": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.0.0.tgz", + "integrity": "sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ==", + "dev": true + }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -7327,6 +5932,12 @@ "is-extglob": "^2.1.1" } }, + "is-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", + "integrity": "sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==", + "dev": true + }, "is-negated-glob": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", @@ -7346,9 +5957,15 @@ "dev": true }, "is-path-inside": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.1.tgz", - "integrity": "sha512-CKstxrctq1kUesU6WhtZDbYKzzYBuRH0UYInAVrkc/EYdB9ltbfE0gOoayG9nhohG6447sOOVGhHqsdmBvkbNg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.2.tgz", + "integrity": "sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg==", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", "dev": true }, "is-plain-object": { @@ -7360,19 +5977,13 @@ "isobject": "^3.0.1" } }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", "dev": true, "requires": { - "has": "^1.0.1" + "has": "^1.0.3" } }, "is-relative": { @@ -7390,19 +6001,31 @@ "integrity": "sha1-MKc/9cw4VOT8JUkICen1q/jeCeA=", "dev": true }, + "is-set": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.1.tgz", + "integrity": "sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==", + "dev": true + }, "is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", "dev": true }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", "dev": true, "requires": { - "has-symbols": "^1.0.0" + "has-symbols": "^1.0.1" } }, "is-typedarray": { @@ -7439,10 +6062,13 @@ "dev": true }, "is-wsl": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.1.1.tgz", - "integrity": "sha512-umZHcSrwlDHo2TGMXv0DZ8dIUGunZ2Iv68YZnrmCiBPkZ4aaOhtv7pXJKeki9k3qJ3RJr0cDyitcl5wEH3AYog==", - "dev": true + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "requires": { + "is-docker": "^2.0.0" + } }, "isarray": { "version": "1.0.0", @@ -7451,13 +6077,10 @@ "dev": true }, "isbinaryfile": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.3.tgz", - "integrity": "sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==", - "dev": true, - "requires": { - "buffer-alloc": "^1.2.0" - } + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.6.tgz", + "integrity": "sha512-ORrEy+SNVqUhrCaal4hA4fBzhggQQ+BaLntyPOdoEiwlKZW9BZiJXjg3RMiruE4tPEI3pyVPpySHQF/dKWperg==", + "dev": true }, "isexe": { "version": "2.0.0", @@ -7518,19 +6141,13 @@ "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", "dev": true }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" } }, "resolve": { @@ -7547,12 +6164,6 @@ "requires": { "has-flag": "^1.0.0" } - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true } } }, @@ -7572,15 +6183,12 @@ } }, "istanbul-lib-instrument": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.0.tgz", - "integrity": "sha512-Nm4wVHdo7ZXSG30KjZ2Wl5SU/Bw7bDx1PdaiIFzEStdjs0H12mOTncn1GVYuqQSaZxpg87VGBRsVRPGD2cD1AQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", "dev": true, "requires": { "@babel/core": "^7.7.5", - "@babel/parser": "^7.7.5", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", "@istanbuljs/schema": "^0.1.2", "istanbul-lib-coverage": "^3.0.0", "semver": "^6.3.0" @@ -7609,76 +6217,20 @@ "uuid": "^3.3.3" }, "dependencies": { - "cross-spawn": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", - "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, "make-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", - "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { "semver": "^6.0.0" } }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "rimraf": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", - "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", - "dev": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } } } }, @@ -7700,9 +6252,9 @@ "dev": true }, "make-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", - "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { "semver": "^6.0.0" @@ -7745,15 +6297,31 @@ } }, "istanbul-reports": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.0.tgz", - "integrity": "sha512-2osTcC8zcOSUkImzN2EWQta3Vdi4WjjKw99P2yWx5mLnigAM0Rd5uYFn1cf2i/Ois45GkNjaoTqc5CxgMSX80A==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", "dev": true, "requires": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" } }, + "iterate-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.1.tgz", + "integrity": "sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw==", + "dev": true + }, + "iterate-value": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/iterate-value/-/iterate-value-1.0.2.tgz", + "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", + "dev": true, + "requires": { + "es-get-iterator": "^1.0.2", + "iterate-iterator": "^1.0.1" + } + }, "javascript-natural-sort": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", @@ -7806,12 +6374,12 @@ "dev": true }, "json5": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz", - "integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", "dev": true, "requires": { - "minimist": "^1.2.0" + "minimist": "^1.2.5" } }, "jsonfile": { @@ -7824,9 +6392,9 @@ } }, "jsx-ast-utils": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.2.1.tgz", - "integrity": "sha512-v3FxCcAf20DayI+uxnCuw795+oOIkVu6EnJ1+kSzhqqTZHNkTZ7B66ZgLp4oLJ/gbA64cI0B7WRoHZMSRdyVRQ==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.2.3.tgz", + "integrity": "sha512-EdIHFMm+1BPynpKOpdPqiOsvnIrInRGJD7bzPZdPkjitQEqpdpUuFpq4T0npZFKTiB3RhWFdGN+oqOJIdhDhQA==", "dev": true, "requires": { "array-includes": "^3.0.3", @@ -7840,39 +6408,53 @@ "dev": true }, "karma": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/karma/-/karma-4.4.1.tgz", - "integrity": "sha512-L5SIaXEYqzrh6b1wqYC42tNsFMx2PWuxky84pK9coK09MvmL7mxii3G3bZBh/0rvD27lqDd0le9jyhzvwif73A==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/karma/-/karma-5.1.0.tgz", + "integrity": "sha512-I3aPbkuIbwuBo6wSog97P5WnnhCgUTsWTu/bEw1vZVQFbXmKO3PK+cfFhZioOgVtJAuQxoyauGNjnwXNHMCxbw==", "dev": true, "requires": { - "bluebird": "^3.3.0", - "body-parser": "^1.16.1", + "body-parser": "^1.19.0", "braces": "^3.0.2", "chokidar": "^3.0.0", - "colors": "^1.1.0", - "connect": "^3.6.0", + "colors": "^1.4.0", + "connect": "^3.7.0", "di": "^0.0.1", - "dom-serialize": "^2.2.0", - "flatted": "^2.0.0", - "glob": "^7.1.1", - "graceful-fs": "^4.1.2", - "http-proxy": "^1.13.0", - "isbinaryfile": "^3.0.0", - "lodash": "^4.17.14", - "log4js": "^4.0.0", - "mime": "^2.3.1", - "minimatch": "^3.0.2", - "optimist": "^0.6.1", - "qjobs": "^1.1.4", - "range-parser": "^1.2.0", - "rimraf": "^2.6.0", - "safe-buffer": "^5.0.1", - "socket.io": "2.1.1", + "dom-serialize": "^2.2.1", + "flatted": "^2.0.2", + "glob": "^7.1.6", + "graceful-fs": "^4.2.4", + "http-proxy": "^1.18.1", + "isbinaryfile": "^4.0.6", + "lodash": "^4.17.15", + "log4js": "^6.2.1", + "mime": "^2.4.5", + "minimatch": "^3.0.4", + "qjobs": "^1.2.0", + "range-parser": "^1.2.1", + "rimraf": "^3.0.2", + "socket.io": "^2.3.0", "source-map": "^0.6.1", - "tmp": "0.0.33", - "useragent": "2.3.0" + "tmp": "0.2.1", + "ua-parser-js": "0.7.21", + "yargs": "^15.3.1" }, "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, "anymatch": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", @@ -7889,38 +6471,77 @@ "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", "dev": true }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, "chokidar": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.2.2.tgz", - "integrity": "sha512-bw3pm7kZ2Wa6+jQWYP/c7bAZy3i4GwiIiMO2EeRjrE48l8vBqC/WvFhSF0xyM8fQiPEGvwMY/5bqDG7sSEOuhg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz", + "integrity": "sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ==", "dev": true, "requires": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.1", + "fsevents": "~2.1.2", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" + "readdirp": "~3.4.0" } }, - "fsevents": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.1.tgz", - "integrity": "sha512-4FRPXWETxtigtJW/gxzEDsX1LVbPAM93VleB83kZB+ellqbHMkyt2aJfuzNLRvFPnGi6bcE5SvfxgbXPeKteJw==", + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dev": true, - "optional": true + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } }, - "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "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": { - "is-glob": "^4.0.1" + "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": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -7930,33 +6551,165 @@ "binary-extensions": "^2.0.0" } }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "readdirp": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", + "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "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 + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "dev": true, + "requires": { + "rimraf": "^3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, - "readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "yargs": { + "version": "15.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", + "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", "dev": true, "requires": { - "picomatch": "^2.0.4" + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.1" } }, - "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 + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } }, "karma-browserstack-launcher": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/karma-browserstack-launcher/-/karma-browserstack-launcher-1.5.1.tgz", - "integrity": "sha512-zt9Ukow5A9WZHZXCFVO/h5kRsAdaZYeMNJK9Uan8v42amQXt3B/DZVxl24NCcAIxufKjW13UWd9iJ9knG9OCYw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/karma-browserstack-launcher/-/karma-browserstack-launcher-1.6.0.tgz", + "integrity": "sha512-Y/UWPdHZkHIVH2To4GWHCTzmrsB6H7PBWy6pw+TWz5sr4HW2mcE+Uj6qWgoVNxvQU1Pfn5LQQzI6EQ65p8QbiQ==", "dev": true, "requires": { "browserstack": "~1.5.1", @@ -7974,12 +6727,12 @@ } }, "karma-mocha": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-1.3.0.tgz", - "integrity": "sha1-7qrH/8DiAetjxGdEDStpx883eL8=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz", + "integrity": "sha512-Tzd5HBjm8his2OA4bouAsATYEpZrp9vC7z5E5j4C5Of5Rrs1jY67RAwXNcVmd/Bnk1wgvQRou0zGVLey44G4tQ==", "dev": true, "requires": { - "minimist": "1.2.0" + "minimist": "^1.2.3" } }, "karma-mocha-reporter": { @@ -8024,6 +6777,17 @@ "webpack-dev-middleware": "^3.7.0" }, "dependencies": { + "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==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, "source-map": { "version": "0.7.3", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", @@ -8033,9 +6797,9 @@ } }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, "last-run": { @@ -8144,13 +6908,13 @@ "dev": true }, "loader-utils": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", - "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", "dev": true, "requires": { "big.js": "^5.2.2", - "emojis-list": "^2.0.0", + "emojis-list": "^3.0.0", "json5": "^1.0.1" }, "dependencies": { @@ -8166,19 +6930,19 @@ } }, "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { - "p-locate": "^3.0.0", + "p-locate": "^2.0.0", "path-exists": "^3.0.0" } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", "dev": true }, "lodash.flattendeep": { @@ -8197,16 +6961,16 @@ } }, "log4js": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-4.5.1.tgz", - "integrity": "sha512-EEEgFcE9bLgaYUKuozyFfytQM2wDHtXn4tAN41pkaxpNjAykv11GVdeI4tHtmPWW4Xrgh9R/2d7XYghDVjbKKw==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.3.0.tgz", + "integrity": "sha512-Mc8jNuSFImQUIateBFwdOQcmC6Q5maU0VVvdC2R6XMb66/VnT+7WS4D/0EeNMZu1YODmJe5NIn2XftCzEocUgw==", "dev": true, "requires": { - "date-format": "^2.0.0", + "date-format": "^3.0.0", "debug": "^4.1.1", - "flatted": "^2.0.0", + "flatted": "^2.0.1", "rfdc": "^1.1.4", - "streamroller": "^1.0.6" + "streamroller": "^2.2.4" } }, "loose-envify": { @@ -8219,13 +6983,12 @@ } }, "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "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": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "yallist": "^3.0.2" } }, "make-dir": { @@ -8247,12 +7010,6 @@ "kind-of": "^6.0.2" } }, - "mamacro": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz", - "integrity": "sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==", - "dev": true - }, "map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", @@ -8469,29 +7226,43 @@ "requires": { "bn.js": "^4.0.0", "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } } }, "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.5.tgz", + "integrity": "sha512-3hQhEUF027BuxZjQA3s7rIv/7VCQPa27hN9u9g87sEkWaKwQPuXOkVKtOeiyUrnWqTDiOs8Ed2rwg733mB0R5w==", "dev": true }, "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", "dev": true }, "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", "dev": true, "requires": { - "mime-db": "1.40.0" + "mime-db": "1.44.0" } }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -8514,9 +7285,9 @@ } }, "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "mississippi": { @@ -8571,47 +7342,48 @@ } }, "mkdirp": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.3.tgz", - "integrity": "sha512-6uCP4Qc0sWsgMLy1EOqqS/3rjDHOEnsStVr/4vtAIK2Y5i2kA7lFFejYrpIyiN9w0pYf4ckeCYT9f1r1P9KX5g==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "dev": true }, "mocha": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.0.1.tgz", - "integrity": "sha512-9eWmWTdHLXh72rGrdZjNbG3aa1/3NRPpul1z0D979QpEnFdCG0Q5tv834N+94QEN2cysfV72YocQ3fn87s70fg==", + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.1.3.tgz", + "integrity": "sha512-ZbaYib4hT4PpF4bdSO2DohooKXIn4lDeiYqB+vTmCdr6l2woW0b6H3pf5x4sM5nwQMru9RvjjHYWVGltR50ZBw==", "dev": true, "requires": { - "ansi-colors": "3.2.3", + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.3.0", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", + "chokidar": "3.4.2", + "debug": "4.1.1", + "diff": "4.0.2", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.6", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "2.2.0", + "js-yaml": "3.14.0", + "log-symbols": "4.0.0", "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "ms": "2.1.1", - "node-environment-flags": "1.0.6", + "ms": "2.1.2", "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", + "promise.allsettled": "1.0.2", + "serialize-javascript": "4.0.0", + "strip-json-comments": "3.0.1", + "supports-color": "7.1.0", + "which": "2.0.2", "wide-align": "1.1.3", - "yargs": "13.3.0", - "yargs-parser": "13.1.1", - "yargs-unparser": "1.6.0" + "workerpool": "6.0.0", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.1" }, "dependencies": { "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, "ansi-regex": { @@ -8620,6 +7392,16 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, "anymatch": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", @@ -8631,9 +7413,9 @@ } }, "binary-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", - "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", "dev": true }, "camelcase": { @@ -8642,20 +7424,30 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, "chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz", + "integrity": "sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==", "dev": true, "requires": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.1", + "fsevents": "~2.1.2", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" + "readdirp": "~3.4.0" } }, "cliui": { @@ -8669,19 +7461,47 @@ "wrap-ansi": "^5.1.0" } }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "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": { - "ms": "^2.1.1" + "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 + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "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" } }, "fsevents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", - "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", "dev": true, "optional": true }, @@ -8691,28 +7511,11 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } + "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 }, "is-binary-path": { "version": "2.1.0", @@ -8729,26 +7532,33 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "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": { - "minimist": "0.0.8" + "p-locate": "^5.0.0" } }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true + "log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "requires": { + "chalk": "^4.0.0" + } }, "normalize-path": { "version": "3.0.0", @@ -8756,13 +7566,43 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, + "p-limit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", + "integrity": "sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==", + "dev": true, + "requires": { + "p-try": "^2.0.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" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, "readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", + "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", "dev": true, "requires": { - "picomatch": "^2.0.4" + "picomatch": "^2.2.1" } }, "require-main-filename": { @@ -8771,6 +7611,15 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, + "serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -8792,12 +7641,21 @@ } }, "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "isexe": "^2.0.0" } }, "which-module": { @@ -8815,6 +7673,32 @@ "ansi-styles": "^3.2.0", "string-width": "^3.0.0", "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + } } }, "y18n": { @@ -8824,9 +7708,9 @@ "dev": true }, "yargs": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", - "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", "dev": true, "requires": { "cliui": "^5.0.0", @@ -8838,13 +7722,58 @@ "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.1" + "yargs-parser": "^13.1.2" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "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" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.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==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } } }, "yargs-parser": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -8867,19 +7796,22 @@ "run-queue": "^1.0.3" }, "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "requires": { - "minimist": "0.0.8" + "glob": "^7.1.3" } } } @@ -8897,15 +7829,15 @@ "dev": true }, "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", "dev": true, "optional": true }, @@ -9031,16 +7963,6 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, - "node-environment-flags": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", - "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", - "dev": true, - "requires": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" - } - }, "node-fetch": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", @@ -9102,21 +8024,10 @@ } }, "node-releases": { - "version": "1.1.47", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.47.tgz", - "integrity": "sha512-k4xjVPx5FpwBUj0Gw7uvFOTF4Ep8Hok1I6qjwL3pLfwe7Y0REQSAqOwwv9TWBCUtMHxcXfY4PgRLRozcChvTcA==", - "dev": true, - "requires": { - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } + "version": "1.1.59", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.59.tgz", + "integrity": "sha512-H3JrdUczbdiwxN5FuJPyCHnGHIFqQ0wWxo+9j1kAXAzqNMAHlo+4I/sYYxpyK0irQ73HgdiyzD32oqQDcU2Osw==", + "dev": true }, "nopt": { "version": "3.0.6", @@ -9170,9 +8081,9 @@ "dev": true }, "nyc": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.0.tgz", - "integrity": "sha512-qcLBlNCKMDVuKb7d1fpxjPR8sHeMVX0CHarXAVzrVWoFrigCkYR8xcrjfXSPi5HXM7EU78L6ywO7w1c5rZNCNg==", + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", "dev": true, "requires": { "@istanbuljs/load-nyc-config": "^1.0.0", @@ -9183,6 +8094,7 @@ "find-cache-dir": "^3.2.0", "find-up": "^4.1.0", "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", "glob": "^7.1.6", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-hook": "^3.0.0", @@ -9190,10 +8102,9 @@ "istanbul-lib-processinfo": "^2.0.2", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.0", - "js-yaml": "^3.13.1", + "istanbul-reports": "^3.0.2", "make-dir": "^3.0.0", - "node-preload": "^0.2.0", + "node-preload": "^0.2.1", "p-map": "^3.0.0", "process-on-spawn": "^1.0.0", "resolve-from": "^5.0.0", @@ -9201,7 +8112,6 @@ "signal-exit": "^3.0.2", "spawn-wrap": "^2.0.0", "test-exclude": "^6.0.0", - "uuid": "^3.3.3", "yargs": "^15.0.2" }, "dependencies": { @@ -9212,9 +8122,9 @@ "dev": true }, "ansi-styles": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.0.tgz", - "integrity": "sha512-7kFQgnEaMdRtwf6uSfUnVr9gSGC7faurn+J/Mv90/W+iTtN0405/nLdopfMWwchyxhbGYl6TC4Sccn9TUkGAgg==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", "dev": true, "requires": { "@types/color-name": "^1.1.1", @@ -9253,29 +8163,14 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "find-cache-dir": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.2.0.tgz", - "integrity": "sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", "dev": true, "requires": { "commondir": "^1.0.1", - "make-dir": "^3.0.0", + "make-dir": "^3.0.2", "pkg-dir": "^4.1.0" } }, @@ -9310,13 +8205,22 @@ "p-locate": "^4.1.0" } }, - "make-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", - "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "requires": { - "semver": "^6.0.0" + "p-try": "^2.0.0" } }, "p-locate": { @@ -9328,6 +8232,12 @@ "p-limit": "^2.2.0" } }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -9349,21 +8259,6 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - }, - "rimraf": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", - "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -9390,12 +8285,6 @@ "ansi-regex": "^5.0.0" } }, - "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", - "dev": true - }, "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", @@ -9420,9 +8309,9 @@ "dev": true }, "yargs": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.0.2.tgz", - "integrity": "sha512-GH/X/hYt+x5hOat4LMnCqMd8r5Cv78heOMIJn1hr7QPPBqfeC6p89Y78+WB9yGDvfpCvgasfmWLzNzEioOUD9Q==", + "version": "15.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", + "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", "dev": true, "requires": { "cliui": "^6.0.0", @@ -9435,13 +8324,13 @@ "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^16.1.0" + "yargs-parser": "^18.1.1" } }, "yargs-parser": { - "version": "16.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-16.1.0.tgz", - "integrity": "sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg==", + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -9539,90 +8428,27 @@ } }, "object.entries": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.0.tgz", - "integrity": "sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.1.tgz", + "integrity": "sha512-ilqR7BgdyZetJutmDPfXCDffGa0/Yzl2ivVNpbx/g4UeWrCdRnFDUBrKJGLhGieRHDATnyZXWBeCb29k9CJysQ==", "dev": true, "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.12.0", + "es-abstract": "^1.17.0-next.1", "function-bind": "^1.1.1", "has": "^1.0.3" } }, "object.fromentries": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.0.tgz", - "integrity": "sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.11.0", - "function-bind": "^1.1.1", - "has": "^1.0.1" - } - }, - "object.getownpropertydescriptors": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", - "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.2.tgz", + "integrity": "sha512-r3ZiBH7MQppDJVLx6fhD618GKNG40CZYH9wgwdhKxBDDbQgjeWGGd4AtkZad84d291YxvWe7bJGuE65Anh0dxQ==", "dev": true, "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.4.tgz", - "integrity": "sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.1.5", - "is-regex": "^1.0.5", - "object-inspect": "^1.7.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.1", - "string.prototype.trimright": "^2.1.1" - } - }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", - "dev": true - }, - "is-callable": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", - "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", - "dev": true - }, - "is-regex": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", - "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - } + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" } }, "object.map": { @@ -9655,13 +8481,13 @@ } }, "object.values": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.0.tgz", - "integrity": "sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", "dev": true, "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.12.0", + "es-abstract": "^1.17.0-next.1", "function-bind": "^1.1.1", "has": "^1.0.3" } @@ -9685,60 +8511,26 @@ } }, "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - }, - "dependencies": { - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - } - } - }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", "dev": true, "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - }, - "dependencies": { - "minimist": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", - "dev": true - } + "mimic-fn": "^2.1.0" } }, "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, "requires": { "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", + "fast-levenshtein": "~2.0.6", "levn": "~0.3.0", "prelude-ls": "~1.1.2", "type-check": "~0.3.2", - "wordwrap": "~1.0.0" - }, - "dependencies": { - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - } + "word-wrap": "~1.2.3" } }, "ordered-read-streams": { @@ -9772,21 +8564,21 @@ "dev": true }, "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { - "p-try": "^2.0.0" + "p-try": "^1.0.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==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { - "p-limit": "^2.0.0" + "p-limit": "^1.1.0" } }, "p-map": { @@ -9799,9 +8591,9 @@ } }, "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, "package-hash": { @@ -9952,9 +8744,9 @@ "dev": true }, "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "path-parse": { @@ -9994,9 +8786,9 @@ } }, "pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", "dev": true, "requires": { "create-hash": "^1.1.2", @@ -10007,9 +8799,9 @@ } }, "picomatch": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", - "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", "dev": true }, "pify": { @@ -10052,6 +8844,15 @@ "load-json-file": "^5.2.0" }, "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, "load-json-file": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", @@ -10065,6 +8866,40 @@ "type-fest": "^0.3.0" } }, + "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" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.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==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", @@ -10080,6 +8915,12 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true + }, + "type-fest": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", + "dev": true } } }, @@ -10101,6 +8942,51 @@ "dev": true, "requires": { "find-up": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "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" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.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==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + } } }, "platform": { @@ -10139,12 +9025,6 @@ "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", "dev": true }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", - "dev": true - }, "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -10178,6 +9058,19 @@ "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", "dev": true }, + "promise.allsettled": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz", + "integrity": "sha512-UpcYW5S1RaNKT6pd+s9jp9K9rlQge1UXKskec0j6Mmuq7UJCvlS2J2/s/yuPN8ehftf9HXMxWlKiPbGGUzpoRg==", + "dev": true, + "requires": { + "array.prototype.map": "^1.0.1", + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "iterate-value": "^1.0.0" + } + }, "prop-types": { "version": "15.7.2", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", @@ -10196,20 +9089,14 @@ "dev": true }, "ps-tree": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.1.tgz", - "integrity": "sha512-kef7fYYSKVqQffmzTMsVcUD1ObNJMp8sNSmHGlGKsZQyL/ht9MZKk86u0Rd1NhpTOAuhqwKCLLpktwkqz+MF8A==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz", + "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==", "dev": true, "requires": { "event-stream": "=3.3.4" } }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, "public-encrypt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", @@ -10222,6 +9109,14 @@ "parse-asn1": "^5.0.0", "randombytes": "^2.0.1", "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } } }, "pump": { @@ -10319,9 +9214,9 @@ } }, "react-is": { - "version": "16.9.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.9.0.tgz", - "integrity": "sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==", + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "dev": true }, "read-pkg": { @@ -10386,9 +9281,9 @@ } }, "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -10526,27 +9421,33 @@ } }, "regenerate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.1.tgz", + "integrity": "sha512-j2+C8+NtXQgEKWk49MMP5P/u2GhnahTtVkRIHr5R5lVRlbKvmQ+oS+A5aLKWp2ma5VkT8sh6v+v4hbH0YHR66A==", "dev": true }, "regenerate-unicode-properties": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz", - "integrity": "sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", "dev": true, "requires": { "regenerate": "^1.4.0" } }, + "regenerator-runtime": { + "version": "0.13.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true + }, "regenerator-transform": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.1.tgz", - "integrity": "sha512-flVuee02C3FKRISbxhXl9mGzdbWUVHubl1SMaknjxkFB1/iqpJhArQUvRxOOPEc/9tAiX0BaQ28FJH10E4isSQ==", + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", "dev": true, "requires": { - "private": "^0.1.6" + "@babel/runtime": "^7.8.4" } }, "regex-not": { @@ -10566,29 +9467,29 @@ "dev": true }, "regexpu-core": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.6.0.tgz", - "integrity": "sha512-YlVaefl8P5BnFYOITTNzDvan1ulLOiXJzCNZxduTIosN17b87h3bvG9yHMoHaRuo88H4mQ06Aodj5VtYGGGiTg==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.0.tgz", + "integrity": "sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ==", "dev": true, "requires": { "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.1.0", - "regjsgen": "^0.5.0", - "regjsparser": "^0.6.0", + "regenerate-unicode-properties": "^8.2.0", + "regjsgen": "^0.5.1", + "regjsparser": "^0.6.4", "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.1.0" + "unicode-match-property-value-ecmascript": "^1.2.0" } }, "regjsgen": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.1.tgz", - "integrity": "sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", "dev": true }, "regjsparser": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.2.tgz", - "integrity": "sha512-E9ghzUtoLwDekPT0DYCp+c4h+bvuUpe6rRHCTYn6eGoqj1LgKXxT6I0Il4WbjhQkOghzi/V+y03bPKvbllL93Q==", + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", + "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", "dev": true, "requires": { "jsesc": "~0.5.0" @@ -10651,9 +9552,9 @@ "dev": true }, "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", "dev": true }, "replace-homedir": { @@ -10686,9 +9587,9 @@ "dev": true }, "resolve": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", - "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -10705,9 +9606,9 @@ } }, "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, "resolve-options": { @@ -10726,12 +9627,12 @@ "dev": true }, "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "requires": { - "onetime": "^2.0.0", + "onetime": "^5.1.0", "signal-exit": "^3.0.2" } }, @@ -10754,9 +9655,9 @@ "dev": true }, "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" @@ -10773,13 +9674,10 @@ } }, "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "dev": true, - "requires": { - "is-promise": "^2.1.0" - } + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true }, "run-parallel": { "version": "1.1.9", @@ -10797,9 +9695,9 @@ } }, "rxjs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz", - "integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -10827,14 +9725,13 @@ "dev": true }, "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": "2.6.6", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.6.6.tgz", + "integrity": "sha512-wHutF/WPSbIi9x6ctjGGk2Hvl0VOz5l3EKEuKbjPlB30mKZUzb9A5k9yEXRX3pwyqVLPvpfZZEllaFq/M718hA==", "dev": true, "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" + "ajv": "^6.12.0", + "ajv-keywords": "^3.4.1" } }, "seed-random": { @@ -10858,10 +9755,13 @@ } }, "serialize-javascript": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz", - "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==", - "dev": true + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz", + "integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } }, "set-blocking": { "version": "2.0.0", @@ -10924,24 +9824,24 @@ } }, "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "shebang-regex": "^3.0.0" } }, "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, "slash": { @@ -11092,61 +9992,44 @@ } }, "socket.io": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.1.1.tgz", - "integrity": "sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.3.0.tgz", + "integrity": "sha512-2A892lrj0GcgR/9Qk81EaY2gYhCBxurV0PfmmESO6p27QPrUK1J3zdns+5QPqvUYK2q657nSj0guoIil9+7eFg==", "dev": true, "requires": { - "debug": "~3.1.0", - "engine.io": "~3.2.0", + "debug": "~4.1.0", + "engine.io": "~3.4.0", "has-binary2": "~1.0.2", "socket.io-adapter": "~1.1.0", - "socket.io-client": "2.1.1", - "socket.io-parser": "~3.2.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } + "socket.io-client": "2.3.0", + "socket.io-parser": "~3.4.0" } }, "socket.io-adapter": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz", - "integrity": "sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs=", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz", + "integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g==", "dev": true }, "socket.io-client": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.1.1.tgz", - "integrity": "sha512-jxnFyhAuFxYfjqIgduQlhzqTcOEQSn+OHKVfAxWaNWa7ecP7xSNk2Dx/3UEsDcY7NcFafxvNvKPmmO7HTwTxGQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.3.0.tgz", + "integrity": "sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA==", "dev": true, "requires": { "backo2": "1.0.2", "base64-arraybuffer": "0.1.5", "component-bind": "1.0.0", "component-emitter": "1.2.1", - "debug": "~3.1.0", - "engine.io-client": "~3.2.0", + "debug": "~4.1.0", + "engine.io-client": "~3.4.0", "has-binary2": "~1.0.2", "has-cors": "1.1.0", "indexof": "0.0.1", "object-component": "0.0.3", "parseqs": "0.0.5", "parseuri": "0.0.5", - "socket.io-parser": "~3.2.0", + "socket.io-parser": "~3.3.0", "to-array": "0.1.4" }, "dependencies": { @@ -11156,60 +10039,64 @@ "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", "dev": true }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } + "isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", + "dev": true }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true + }, + "socket.io-parser": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz", + "integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==", + "dev": true, + "requires": { + "component-emitter": "1.2.1", + "debug": "~3.1.0", + "isarray": "2.0.1" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } } } }, "socket.io-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.2.0.tgz", - "integrity": "sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.1.tgz", + "integrity": "sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A==", "dev": true, "requires": { "component-emitter": "1.2.1", - "debug": "~3.1.0", + "debug": "~4.1.0", "isarray": "2.0.1" }, "dependencies": { "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true }, "isarray": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true } } }, @@ -11226,12 +10113,12 @@ "dev": true }, "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", "dev": true, "requires": { - "atob": "^2.1.1", + "atob": "^2.1.2", "decode-uri-component": "^0.2.0", "resolve-url": "^0.2.1", "source-map-url": "^0.4.0", @@ -11239,9 +10126,9 @@ } }, "source-map-support": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", - "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -11283,23 +10170,14 @@ }, "dependencies": { "make-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", - "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { "semver": "^6.0.0" } }, - "rimraf": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", - "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -11328,9 +10206,9 @@ } }, "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, "spdx-expression-parse": { @@ -11389,13 +10267,13 @@ "dev": true }, "standard": { - "version": "14.3.1", - "resolved": "https://registry.npmjs.org/standard/-/standard-14.3.1.tgz", - "integrity": "sha512-TUQwU7znlZLfgKH1Zwn/D84FitWZkUTfbxSiz/vFx+4c9GV+clSfG/qLiLZOlcdyzhw3oF5/pZydNjbNDfHPEw==", + "version": "14.3.4", + "resolved": "https://registry.npmjs.org/standard/-/standard-14.3.4.tgz", + "integrity": "sha512-+lpOkFssMkljJ6eaILmqxHQ2n4csuEABmcubLTb9almFi1ElDzXb1819fjf/5ygSyePCq4kU2wMdb2fBfb9P9Q==", "dev": true, "requires": { - "eslint": "~6.4.0", - "eslint-config-standard": "14.1.0", + "eslint": "~6.8.0", + "eslint-config-standard": "14.1.1", "eslint-config-standard-jsx": "8.1.0", "eslint-plugin-import": "~2.18.0", "eslint-plugin-node": "~10.0.0", @@ -11406,14 +10284,14 @@ } }, "standard-engine": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-12.0.0.tgz", - "integrity": "sha512-gJIIRb0LpL7AHyGbN9+hJ4UJns37lxmNTnMGRLC8CFrzQ+oB/K60IQjKNgPBCB2VP60Ypm6f8DFXvhVWdBOO+g==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-12.0.1.tgz", + "integrity": "sha512-XtR9NfoTqvHkWQCwL1aLMwXw1Qxy5s4rdSIqetgBNw+8faNbQ+BbB49hPhKXjxxfC4yg+fpH0lx/T5fuUbpDcQ==", "dev": true, "requires": { - "deglob": "^4.0.0", + "deglob": "^4.0.1", "get-stdin": "^7.0.0", - "minimist": "^1.1.0", + "minimist": "^1.2.5", "pkg-conf": "^3.1.0" } }, @@ -11502,41 +10380,27 @@ } }, "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", "dev": true }, "streamroller": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-1.0.6.tgz", - "integrity": "sha512-3QC47Mhv3/aZNFpDDVO44qQb9gwB9QggMEE0sQmkTAwBVYdBRWISdsywlkfm5II1Q5y/pmrHflti/IgmIzdDBg==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-2.2.4.tgz", + "integrity": "sha512-OG79qm3AujAM9ImoqgWEY1xG4HX+Lw+yY6qZj9R1K2mhF5bEmQ849wvrb+4vt4jLMLzwXttJlQbOdPOQVRv7DQ==", "dev": true, "requires": { - "async": "^2.6.2", - "date-format": "^2.0.0", - "debug": "^3.2.6", - "fs-extra": "^7.0.1", - "lodash": "^4.17.14" + "date-format": "^2.1.0", + "debug": "^4.1.1", + "fs-extra": "^8.1.0" }, "dependencies": { - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } + "date-format": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.1.0.tgz", + "integrity": "sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA==", + "dev": true } } }, @@ -11551,24 +10415,46 @@ "strip-ansi": "^3.0.0" } }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "string.prototype.trimleft": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", - "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", "dev": true, "requires": { "define-properties": "^1.1.3", - "function-bind": "^1.1.1" + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" } }, "string.prototype.trimright": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", - "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", "dev": true, "requires": { "define-properties": "^1.1.3", - "function-bind": "^1.1.1" + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" } }, "string_decoder": { @@ -11599,9 +10485,9 @@ } }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", "dev": true }, "stubs": { @@ -11653,6 +10539,12 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -11698,24 +10590,6 @@ "node-fetch": "^2.2.0", "stream-events": "^1.0.5", "uuid": "^3.3.2" - }, - "dependencies": { - "agent-base": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", - "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==", - "dev": true - }, - "https-proxy-agent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", - "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", - "dev": true, - "requires": { - "agent-base": "5", - "debug": "4" - } - } } }, "temp-fs": { @@ -11739,9 +10613,9 @@ } }, "terser": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.3.tgz", - "integrity": "sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", + "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", "dev": true, "requires": { "commander": "^2.20.0", @@ -11758,16 +10632,16 @@ } }, "terser-webpack-plugin": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz", - "integrity": "sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.4.tgz", + "integrity": "sha512-U4mACBHIegmfoEe5fdongHESNJWqsGU+W0S/9+BmYGVQDw1+c2Ow05TpMhxjPK1sRb7cuYq1BPl1e5YHJMTCqA==", "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": "^2.1.2", + "serialize-javascript": "^3.1.0", "source-map": "^0.6.1", "terser": "^4.1.2", "webpack-sources": "^1.4.0", @@ -11780,6 +10654,17 @@ "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", "dev": true }, + "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==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -11945,9 +10830,9 @@ "dev": true }, "tslib": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.2.tgz", + "integrity": "sha512-tTSkux6IGPnUGUd1XAZHcpu85MOkIl5zX49pO+jfsie3eP0B6pyhOlLXm3cAC6T7s+euSDDUUV+Acop5WmtkVg==", "dev": true }, "tty-browserify": { @@ -11957,9 +10842,9 @@ "dev": true }, "type": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/type/-/type-1.0.3.tgz", - "integrity": "sha512-51IMtNfVcee8+9GJvj0spSuFcZHe9vSib6Xtgsny1Km9ugyz2mbS08I3rsUIRYgJohFRFU1160sgRodYz378Hg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", "dev": true }, "type-check": { @@ -11972,9 +10857,9 @@ } }, "type-fest": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", - "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true }, "type-is": { @@ -11988,9 +10873,9 @@ } }, "typed-function": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-1.1.1.tgz", - "integrity": "sha512-RbN7MaTQBZLJYzDENHPA0nUmWT0Ex80KHItprrgbTPufYhIlTePvCXZxyQK7wgn19FW5bnuaBIKcBb5mRWjB1Q==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-2.0.0.tgz", + "integrity": "sha512-Hhy1Iwo/e4AtLZNK10ewVVcP2UEs408DS35ubP825w/YgSBK1KVLwALvvIG4yX75QJrxjCpcWkzkVRB0BwwYlA==" }, "typedarray": { "version": "0.0.6", @@ -11999,9 +10884,9 @@ "dev": true }, "typedarray-pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/typedarray-pool/-/typedarray-pool-1.1.0.tgz", - "integrity": "sha1-0RT0hIAUifU+yrXoCIqiMET0mNk=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/typedarray-pool/-/typedarray-pool-1.2.0.tgz", + "integrity": "sha512-YTSQbzX43yvtpfRtIDAYygoYtgT+Rpjuxy9iOpczrjpXLgGoyG7aS5USJXV2d3nn8uHTeb9rXDvzS27zUg5KYQ==", "dev": true, "requires": { "bit-twiddle": "^1.0.0", @@ -12017,28 +10902,16 @@ "is-typedarray": "^1.0.0" } }, - "uglify-js": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.8.0.tgz", - "integrity": "sha512-ugNSTT8ierCsDHso2jkBHXYrU8Y5/fY2ZUprfrJUiD7YpuFvV4jODLFmb3h4btQjqr5Nh4TX4XtgDfCU1WdioQ==", - "dev": true, - "requires": { - "commander": "~2.20.3", - "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 - } - } + "ua-parser-js": { + "version": "0.7.21", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.21.tgz", + "integrity": "sha512-+O8/qh/Qj8CgC6eYBVBykMrNtp5Gebn4dlGD/kKXVkJNDwyrAwSIqwz8CDf+tsAIWVycKcku6gIXJ0qwx/ZXaQ==", + "dev": true }, - "ultron": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", - "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", + "uglify-js": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.0.tgz", + "integrity": "sha512-Esj5HG5WAyrLIdYU74Z3JdG2PxdIusvj6IWHMtlyESxc7kcDz7zYlYjpnSokn1UbpV0d/QX9fan7gkCNd/9BQA==", "dev": true }, "unc-path-regex": { @@ -12048,9 +10921,9 @@ "dev": true }, "underscore": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.2.tgz", - "integrity": "sha512-D39qtimx0c1fI3ya1Lnhk3E9nONswSKhnffBI0gME9C99fYOkNi04xs8K6pePLhvl1frbDemkaBQ5ikWllR2HQ==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz", + "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==", "dev": true }, "undertaker": { @@ -12093,15 +10966,15 @@ } }, "unicode-match-property-value-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz", - "integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", "dev": true }, "unicode-property-aliases-ecmascript": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz", - "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", "dev": true }, "union-value": { @@ -12203,9 +11076,9 @@ } }, "upath": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", - "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", "dev": true }, "uri-js": { @@ -12253,16 +11126,6 @@ "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true }, - "useragent": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/useragent/-/useragent-2.3.0.tgz", - "integrity": "sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw==", - "dev": true, - "requires": { - "lru-cache": "4.1.x", - "tmp": "0.0.x" - } - }, "util": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", @@ -12293,9 +11156,9 @@ "dev": true }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, "v8-compile-cache": { @@ -12405,51 +11268,133 @@ "dev": true }, "watchpack": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", - "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.4.tgz", + "integrity": "sha512-aWAgTW4MoSJzZPAicljkO1hsi1oKj/RRq/OJQh2PKI2UKL04c2Bs+MBOB+BBABHTXJpf9mCwHN7ANCvYsvY2sg==", "dev": true, "requires": { - "chokidar": "^2.0.2", + "chokidar": "^3.4.1", "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0" + "neo-async": "^2.5.0", + "watchpack-chokidar2": "^2.0.0" + }, + "dependencies": { + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "optional": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "binary-extensions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", + "dev": true, + "optional": true + }, + "chokidar": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.1.tgz", + "integrity": "sha512-TQTJyr2stihpC4Sya9hs2Xh+O2wf+igjL36Y75xx2WdHuiICcn/XJza46Jwt0eT5hVpQOzo3FpY3cj3RVYLX0g==", + "dev": true, + "optional": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.4.0" + } + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "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" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "optional": true + }, + "readdirp": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", + "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", + "dev": true, + "optional": true, + "requires": { + "picomatch": "^2.2.1" + } + } + } + }, + "watchpack-chokidar2": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.0.tgz", + "integrity": "sha512-9TyfOyN/zLUbA288wZ8IsMZ+6cbzvsNyEzSBp6e/zkifi6xxbl8SmQ/CxQq32k8NNqrdVEVUVSEf56L4rQ/ZxA==", + "dev": true, + "optional": true, + "requires": { + "chokidar": "^2.1.8" } }, "webpack": { - "version": "4.41.6", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.41.6.tgz", - "integrity": "sha512-yxXfV0Zv9WMGRD+QexkZzmGIh54bsvEs+9aRWxnN8erLWEOehAKUTeNBoUbA6HPEZPlRo7KDi2ZcNveoZgK9MA==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.44.0.tgz", + "integrity": "sha512-wAuJxK123sqAw31SpkPiPW3iKHgFUiKvO7E7UZjtdExcsRe3fgav4mvoMM7vvpjLHVoJ6a0Mtp2fzkoA13e0Zw==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-module-context": "1.8.5", - "@webassemblyjs/wasm-edit": "1.8.5", - "@webassemblyjs/wasm-parser": "1.8.5", - "acorn": "^6.2.1", + "@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", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.1.0", + "enhanced-resolve": "^4.3.0", "eslint-scope": "^4.0.3", "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.1", + "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.6.0", + "watchpack": "^1.7.4", "webpack-sources": "^1.4.1" }, "dependencies": { "acorn": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", - "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", "dev": true }, "braces": { @@ -12561,19 +11506,24 @@ "to-regex": "^3.0.2" } }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "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==", "dev": true, "requires": { - "minimist": "0.0.8" + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" } }, "to-regex-range": { @@ -12589,15 +11539,27 @@ } }, "webpack-dev-middleware": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.7.0.tgz", - "integrity": "sha512-qvDesR1QZRIAZHOE3iQ4CXLZZSQ1lAUsSpnQmlB1PBfoN/xdRjmge3Dok0W4IdaVLJOGJy3sGI4sZHwjRU0PCA==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.7.2.tgz", + "integrity": "sha512-1xC42LxbYoqLNAhV6YzTYacicgMZQTqRd27Sim9wn5hJrX3I5nxYy1SxSd4+gjUFsz1dQFj+yEe6zEVmSkeJjw==", "dev": true, "requires": { "memory-fs": "^0.4.1", - "mime": "^2.4.2", + "mime": "^2.4.4", + "mkdirp": "^0.5.1", "range-parser": "^1.2.1", "webpack-log": "^2.0.0" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + } } }, "webpack-log": { @@ -12660,10 +11622,16 @@ "string-width": "^1.0.2 || 2" } }, + "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 + }, "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, "worker-farm": { @@ -12675,6 +11643,12 @@ "errno": "~0.1.7" } }, + "workerpool": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz", + "integrity": "sha512-fU2OcNA/GVAJLLyKUoHkAgIhKb0JoCpSjLC/G2vYKxUjVmQwGbRVeoPJ1a8U4pnVofz4AQV5Y/NEw8oKqxEBtA==", + "dev": true + }, "wrap-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", @@ -12700,27 +11674,21 @@ "mkdirp": "^0.5.1" }, "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" } } } }, "write-file-atomic": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.1.tgz", - "integrity": "sha512-JPStrIyyVJ6oCSz/691fAjFtefZ6q+fP6tm+OS4Qw6o+TGQxNp1ziY2PgS+X/m0V8OWhZiO/m4xSj+Pr4RrZvw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, "requires": { "imurmurhash": "^0.1.4", @@ -12730,15 +11698,10 @@ } }, "ws": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", - "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" - } + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz", + "integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w==", + "dev": true }, "xmlhttprequest-ssl": { "version": "1.5.5", @@ -12759,9 +11722,9 @@ "dev": true }, "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, "yargs": { @@ -12795,14 +11758,16 @@ } }, "yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.1.tgz", + "integrity": "sha512-qZV14lK9MWsGCmcr7u5oXGH0dbGqZAIxTDrWXZDo5zUr6b6iUmelNKO6x6R1dQT24AH3LgRxJpr8meWy2unolA==", "dev": true, "requires": { + "camelcase": "^5.3.1", + "decamelize": "^1.2.0", "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" + "is-plain-obj": "^1.1.0", + "yargs": "^14.2.3" }, "dependencies": { "ansi-regex": { @@ -12828,6 +11793,21 @@ "wrap-ansi": "^5.1.0" } }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -12840,6 +11820,40 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "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" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.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==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -12890,12 +11904,13 @@ "dev": true }, "yargs": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", - "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", + "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", "dev": true, "requires": { "cliui": "^5.0.0", + "decamelize": "^1.2.0", "find-up": "^3.0.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", @@ -12904,13 +11919,13 @@ "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.1" + "yargs-parser": "^15.0.1" } }, "yargs-parser": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", + "integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", "dev": true, "requires": { "camelcase": "^5.0.0", diff --git a/package.json b/package.json index fc70a52843..5f549e43e7 100644 --- a/package.json +++ b/package.json @@ -1,105 +1,8 @@ { "name": "mathjs", - "version": "6.6.0", + "version": "7.1.0", "description": "Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices.", "author": "Jos de Jong (https://github.com/josdejong)", - "contributors": [ - "Adam Kelly (https://github.com/adamisntdead)", - "Albert Emil (https://github.com/AlbertEmil)", - "Alexander Beyn (https://github.com/AlexanderBeyn)", - "Andy Pan (https://github.com/andy0130tw)", - "Arkajit Mandal (https://github.com/arkajitmandal)", - "Arthur Guiot (https://github.com/arguiot)", - "Bart Kiers (https://github.com/bkiers)", - "Bartosz Leoniak (https://github.com/kmdrGroch)", - "Ben Weinshel (https://github.com/weinshel)", - "Benjamin Lucas (https://github.com/bnlcas)", - "Brett Jurgens (https://github.com/brettjurgens)", - "Bryan Cuccioli (https://github.com/bcuccioli)", - "Chris Chudzicki (https://github.com/ChristopherChudzicki)", - "Chris Hadgis (https://github.com/SzechuanSage)", - "Clinton Curry (https://github.com/clintonc)", - "Dakota Blair (https://github.com/dakotablair)", - "David Bramwell (https://github.com/dbramwell)", - "Daniel Kostro (https://github.com/stropitek)", - "Daniel Levin (https://github.com/daniel-levin)", - "David Simons (https://github.com/SwamWithTurtles)", - "denisx (https://github.com/denisx)", - "dkenul (https://github.com/dkenul)", - "Devan Patel (https://github.com/devanp92)", - "devdevdata222 (https://github.com/devdevdata222)", - "Dzmitry Litskalau (https://github.com/litmit)", - "Ekin Koc (https://github.com/eknkc)", - "Elijah Insua (https://github.com/tmpvar)", - "Eric Mansfield (https://github.com/ericman314)", - "Fabrice Colas (https://github.com/fabricecolas)", - "Favian Contreras (https://github.com/BigFav)", - "Finn Pauls (https://github.com/finnp)", - "Ganga Christopher (https://github.com/gangachris)", - "Gary Passero (https://github.com/gap777)", - "Gold Holk (https://github.com/GHolk)", - "Harry Sarson (https://github.com/HarrySarson)", - "Holman Gao (https://github.com/golmansax)", - "Honybar (https://github.com/honeybar)", - "Guillermo Indalecio Fernández (https://github.com/guillermobox)", - "Gulfaraz (https://github.com/gulfaraz)", - "hamadu (https://github.com/hamadu)", - "Harsh Gupta (https://github.com/hgupta9)", - "Henrique Ferrolho (https://github.com/ferrolho)", - "Huseyn Guliyev (https://github.com/husayt)", - "Ivan Vergiliev (IvanVergiliev)", - "jean-emmanuel (https://github.com/jean-emmanuel)", - "Jack Schmidt (https://github.com/jackschmidt)", - "Jackie Han (https://github.com/hanguokai)", - "Jason Shin (https://github.com/JasonShin)", - "Jim Garrison (https://github.com/garrison)", - "Joel Hoover (https://github.com/joelhoover)", - "Karl Lew (https://github.com/firepick1)", - "Kenan Yildirim (https://github.com/KenanY)", - "Keunhong Park (https://github.com/void42)", - "Keunhong Park (https://github.com/kevjin)", - "Kevin J (https://github.com/kv-kunalvyas)", - "Marcus Andre (https://github.com/marcusandre)", - "Horatiu Lazu (https://github.com/MathBunny)", - "Mathias Polligkeit (https://github.com/woylie)", - "Mathias Rasmussen (https://github.com/mathiasvr)", - "Max Bruckner (https://github.com/FSMaxB)", - "Maxence Dalmais (https://github.com/maxired)", - "Michael M. (https://github.com/Schnark)", - "Mitchel Kelonye (https://github.com/kelonye)", - "mtraynham (https://github.com/mtraynham)", - "Niels Heisterkamp (https://github.com/nheisterkamp)", - "Oleg (https://github.com/ovk)", - "Owen Versteeg (https://github.com/owenversteeg)", - "Pavel Panchekha (https://github.com/pavpanchekha)", - "Pat Grasso (https://github.com/patgrasso)", - "Paulo Buchsbaum (https://github.com/paulobuchsbaum)", - "Pete Corey (https://github.com/pcorey)", - "PJ Hampton (https://github.com/pjhampton )", - "Retsam (https://github.com/Retsam)", - "Rian McGuire (https://github.com/rianmcguire)", - "Robert Eisele (https://github.com/infusion)", - "Rogelio J. Baucells (https://github.com/rjbaucells)", - "Ryan Seys (https://github.com/ryanseys)", - "Saket Saurabh (https://github.com/ssaket)", - "Sathish Kumar Subramani (https://github.com/Sathish-kumar-Subramani )", - "Sebastien Piquemal (https://github.com/sebpiq)", - "Sebastian Ruhleder (https://github.com/ruhleder)", - "Sergey Romanov (https://github.com/saromanov)", - "Slava Ganzin (https://github.com/slavaGanzin)", - "Stu Blair (https://github.com/stu-blair)", - "Tanmay (https://github.com/maytanthegeek)", - "Thomas Brierley (https://github.com/ThomasBrierley)", - "Timothy Lee (https://github.com/tetslee)", - "Tom MacWright (https://github.com/tmcw)", - "Tóth Róbert (https://github.com/Nekomajin42)", - "Todd Morse (https://github.com/morsecodist)", - "Veeloxfire (https://github.com/Veeloxfire)", - "Vlad Levitskiy (https://github.com/mcvladthegoat)", - "Waldir Pimenta (https://github.com/waldyrious)", - "Waseem Yusuf (https://github.com/waseemyusuf)", - "Zach Zibrat (https://github.com/palimpsests)" - ], "homepage": "https://mathjs.org", "repository": { "type": "git", @@ -129,64 +32,69 @@ "javascript-natural-sort": "^0.7.1", "seed-random": "^2.2.0", "tiny-emitter": "^2.1.0", - "typed-function": "^1.1.1" + "typed-function": "^2.0.0" }, "devDependencies": { - "@babel/core": "7.8.4", - "@babel/plugin-transform-object-assign": "7.8.3", - "@babel/preset-env": "7.8.4", - "@babel/register": "7.8.3", - "babel-loader": "8.0.6", + "@babel/core": "7.10.5", + "@babel/plugin-transform-object-assign": "7.10.4", + "@babel/preset-env": "7.10.4", + "@babel/register": "7.10.5", + "babel-loader": "8.1.0", "benchmark": "2.1.4", - "codecov": "3.6.5", + "codecov": "3.7.2", "del": "5.1.0", "expr-eval": "2.0.2", "fancy-log": "1.3.3", "glob": "7.1.6", "gulp": "4.0.2", "gulp-babel": "8.0.0", - "handlebars": "4.7.3", + "handlebars": "4.7.6", "istanbul": "0.4.5", "jsep": "0.3.4", - "karma": "4.4.1", - "karma-browserstack-launcher": "1.5.1", + "karma": "5.1.0", + "karma-browserstack-launcher": "1.6.0", "karma-firefox-launcher": "1.3.0", - "karma-mocha": "1.3.0", + "karma-mocha": "2.0.1", "karma-mocha-reporter": "2.2.5", "karma-webpack": "4.0.2", "math-expression-evaluator": "1.2.22", - "mkdirp": "1.0.3", - "mocha": "7.0.1", + "mkdirp": "1.0.4", + "mocha": "^8.1.3", "ndarray": "1.0.19", "ndarray-determinant": "1.0.0", "ndarray-gemm": "1.0.0", "ndarray-ops": "1.2.2", "ndarray-pack": "1.2.1", "numericjs": "1.2.6", - "nyc": "15.0.0", + "nyc": "15.1.0", "pad-right": "0.2.2", - "standard": "14.3.1", + "standard": "14.3.4", "sylvester": "0.0.21", - "uglify-js": "3.8.0", - "underscore": "1.9.2", - "webpack": "4.41.6", + "uglify-js": "3.10.0", + "underscore": "1.10.2", + "webpack": "4.44.0", "zeros": "1.0.0" }, - "main": "main/es5", - "module": "main/esm", - "unpkg": "dist/math.min.js", - "jsdelivr": "dist/math.min.js", + "type": "module", + "main": "./lib/cjs", + "module": "./lib/esm", + "unpkg": "./lib/browser/math.min.js", + "jsdelivr": "./lib/browser/math.min.js", + "exports": { + ".": { + "import": "./lib/esm/index.js", + "require": "./lib/cjs/index.js" + }, + "./number": { + "import": "./lib/esm/number.js", + "require": "./lib/cjs/number.js" + }, + "./package.json": "./package.json" + }, "files": [ "bin", - "dist", "docs", - "main", - "es", "lib", - "src", - "core.js", - "index.js", - "number.js", "examples", "LICENSE", "NOTICE", @@ -195,26 +103,31 @@ "CONTRIBUTING.md" ], "scripts": { - "build": "gulp", - "build-and-test": "npm run build && npm run test:src && npm run test:generated && npm run test:node && npm run lint", - "compile": "gulp compile", - "watch": "gulp watch", + "build": "gulp --gulpfile gulpfile.cjs", + "build-and-test": "npm run build && npm run test:all && npm run lint", + "build:clean": "gulp --gulpfile gulpfile.cjs clean", + "build:docs": "gulp --gulpfile gulpfile.cjs docs", + "compile": "gulp --gulpfile gulpfile.cjs compile", + "watch": "gulp --gulpfile gulpfile.cjs watch", "lint": "standard --env=mocha --env=worker", - "validate:ascii": "gulp validate:ascii", + "validate:ascii": "gulp --gulpfile gulpfile.cjs validate:ascii", "test": "npm run test:src && npm run lint", "test:src": "mocha test/unit-tests --recursive --require @babel/register --forbid-only", "test:generated": "mocha test/generated-code-tests --recursive --require @babel/register --forbid-only", "test:node": "mocha test/node-tests/*.test.js test/node-tests/**/*.test.js --recursive --forbid-only", + "test:all": "npm run test:src && npm run test:generated && npm run test:node", "test:browser": "karma start test/browser-test-config/local-karma.js", "test:browserstack": "karma start test/browser-test-config/browserstack-karma.js", "coverage": "nyc --reporter=lcov --reporter=text-summary mocha test/unit-tests --recursive --require @babel/register && echo \"\nDetailed coverage report is available at ./coverage/lcov-report/index.html\"", - "prepublishOnly": "npm run build-and-test" + "prepublishOnly": "npm run test:all && npm run lint", + "prepare": "npm run build", + "update-authors": "node ./tools/update-authors.js" }, "bin": { "mathjs": "./bin/cli.js" }, "engines": { - "node": ">= 8" + "node": ">= 10" }, "bugs": { "url": "https://github.com/josdejong/mathjs/issues" @@ -222,7 +135,6 @@ "directories": { "doc": "./docs", "example": "./examples", - "es": "./es", "lib": "./lib", "src": "./src", "test": "./test" diff --git a/src/bundleAny.cjs b/src/bundleAny.cjs new file mode 100644 index 0000000000..3d4213458b --- /dev/null +++ b/src/bundleAny.cjs @@ -0,0 +1,7 @@ +var all = require('./factoriesAny.js') +var coreCreate = require('./core/create.js') + +var defaultInstance = coreCreate.create(all) + +// TODO: not nice having to revert to CommonJS, find an ES6 solution +module.exports = /* #__PURE__ */ defaultInstance diff --git a/src/bundleAny.js b/src/bundleAny.js deleted file mode 100644 index 4fa43f7bb8..0000000000 --- a/src/bundleAny.js +++ /dev/null @@ -1,7 +0,0 @@ -const all = require('./factoriesAny') -const { create } = require('./core/create') - -const defaultInstance = create(all) - -// TODO: not nice having to revert to CommonJS, find an ES6 solution -module.exports = /* #__PURE__ */ defaultInstance diff --git a/src/constants.js b/src/constants.js index f8790de4c1..90b279d50a 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,12 +1,12 @@ -import { factory } from './utils/factory' -import { version } from './version' +import { factory } from './utils/factory.js' +import { version } from './version.js' import { createBigNumberE, createBigNumberPhi, createBigNumberPi, createBigNumberTau -} from './utils/bignumber/constants' -import { pi, tau, e, phi } from './plain/number' +} from './utils/bignumber/constants.js' +import { pi, tau, e, phi } from './plain/number/index.js' export const createTrue = /* #__PURE__ */ factory('true', [], () => true) export const createFalse = /* #__PURE__ */ factory('false', [], () => false) diff --git a/src/core/create.js b/src/core/create.js index 17c7b59ea8..dcb416fb0f 100644 --- a/src/core/create.js +++ b/src/core/create.js @@ -1,9 +1,9 @@ -import './../utils/polyfills' -import { deepFlatten, isLegacyFactory, lazy, traverse, values } from './../utils/object' -import * as emitter from './../utils/emitter' -import { importFactory } from './function/import' -import { configFactory } from './function/config' -import { factory, isFactory } from '../utils/factory' +import './../utils/polyfills.js' +import { deepFlatten, isLegacyFactory, values } from '../utils/object.js' +import * as emitter from './../utils/emitter.js' +import { importFactory } from './function/import.js' +import { configFactory } from './function/config.js' +import { factory, isFactory } from '../utils/factory.js' import { isAccessorNode, isArray, @@ -43,13 +43,11 @@ import { isSymbolNode, isUndefined, isUnit -} from '../utils/is' -import { initial, last } from '../utils/array' -import { warnOnce } from '../utils/log' -import { ArgumentsError } from '../error/ArgumentsError' -import { DimensionError } from '../error/DimensionError' -import { IndexError } from '../error/IndexError' -import { DEFAULT_CONFIG } from './config' +} from '../utils/is.js' +import { ArgumentsError } from '../error/ArgumentsError.js' +import { DimensionError } from '../error/DimensionError.js' +import { IndexError } from '../error/IndexError.js' +import { DEFAULT_CONFIG } from './config.js' /** * Create a mathjs instance from given factory functions and optionally config @@ -234,103 +232,6 @@ export function create (factories, config) { // else they will get a different naming (`createAdd` instead of `add`). math.import(values(deepFlatten(factories))) - // TODO: deprecated since v6.0.0. Clean up some day - const movedNames = [ - 'type.isNumber', - 'type.isComplex', - 'type.isBigNumber', - 'type.isFraction', - 'type.isUnit', - 'type.isString', - 'type.isArray', - 'type.isMatrix', - 'type.isDenseMatrix', - 'type.isSparseMatrix', - 'type.isCollection', - 'type.isRange', - 'type.isIndex', - 'type.isBoolean', - 'type.isResultSet', - 'type.isHelp', - 'type.isFunction', - 'type.isDate', - 'type.isRegExp', - 'type.isObject', - 'type.isNull', - 'type.isUndefined', - 'type.isAccessorNode', - 'type.isArrayNode', - 'type.isAssignmentNode', - 'type.isBlockNode', - 'type.isConditionalNode', - 'type.isConstantNode', - 'type.isFunctionAssignmentNode', - 'type.isFunctionNode', - 'type.isIndexNode', - 'type.isNode', - 'type.isObjectNode', - 'type.isOperatorNode', - 'type.isParenthesisNode', - 'type.isRangeNode', - 'type.isSymbolNode', - 'type.isChain', - 'type.BigNumber', - 'type.Chain', - 'type.Complex', - 'type.Fraction', - 'type.Matrix', - 'type.DenseMatrix', - 'type.SparseMatrix', - 'type.Spa', - 'type.FibonacciHeap', - 'type.ImmutableDenseMatrix', - 'type.Index', - 'type.Range', - 'type.ResultSet', - 'type.Unit', - 'type.Help', - 'type.Parser', - 'expression.parse', - 'expression.Parser', - 'expression.node.AccessorNode', - 'expression.node.ArrayNode', - 'expression.node.AssignmentNode', - 'expression.node.BlockNode', - 'expression.node.ConditionalNode', - 'expression.node.ConstantNode', - 'expression.node.IndexNode', - 'expression.node.FunctionAssignmentNode', - 'expression.node.FunctionNode', - 'expression.node.Node', - 'expression.node.ObjectNode', - 'expression.node.OperatorNode', - 'expression.node.ParenthesisNode', - 'expression.node.RangeNode', - 'expression.node.RelationalNode', - 'expression.node.SymbolNode', - 'json.reviver', - 'error.ArgumentsError', - 'error.DimensionError', - 'error.IndexError' - ] - movedNames.forEach(fullName => { - const parts = fullName.split('.') - - const path = initial(parts) - const name = last(parts) - const obj = traverse(math, path) - - lazy(obj, name, () => { - warnOnce(`math.${fullName} is moved to math.${name} in v6.0.0. ` + - 'Please use the new location instead.') - return math[name] - }) - }) - lazy(math.expression, 'docs', () => { - throw new Error('math.expression.docs has been moved. ' + - 'Please import via "import { docs } from \'mathjs\'"') - }) - math.ArgumentsError = ArgumentsError math.DimensionError = DimensionError math.IndexError = IndexError diff --git a/src/core/function/config.js b/src/core/function/config.js index b91774c93a..b93f76fae1 100644 --- a/src/core/function/config.js +++ b/src/core/function/config.js @@ -1,5 +1,5 @@ -import { clone, mapObject, deepExtend } from '../../utils/object' -import { DEFAULT_CONFIG } from '../config' +import { clone, mapObject, deepExtend } from '../../utils/object.js' +import { DEFAULT_CONFIG } from '../config.js' export const MATRIX_OPTIONS = ['Matrix', 'Array'] // valid values for option matrix export const NUMBER_OPTIONS = ['number', 'BigNumber', 'Fraction'] // valid values for option number @@ -97,20 +97,6 @@ function contains (array, item) { return array.indexOf(item) !== -1 } -/** - * Find a string in an array. Case insensitive search - * @param {Array.} array - * @param {string} item - * @return {number} Returns the index when found. Returns -1 when not found - */ -function findIndex (array, item) { - return array - .map(function (i) { - return i.toLowerCase() - }) - .indexOf(item.toLowerCase()) -} - /** * Validate an option * @param {Object} options Object with options @@ -119,16 +105,8 @@ function findIndex (array, item) { */ function validateOption (options, name, values) { if (options[name] !== undefined && !contains(values, options[name])) { - const index = findIndex(values, options[name]) - if (index !== -1) { - // right value, wrong casing - // TODO: lower case values are deprecated since v3, remove this warning some day. - console.warn('Warning: Wrong casing for configuration option "' + name + '", should be "' + values[index] + '" instead of "' + options[name] + '".') - - options[name] = values[index] // change the option to the right casing - } else { - // unknown value - console.warn('Warning: Unknown value "' + options[name] + '" for configuration option "' + name + '". Available options: ' + values.map(JSON.stringify).join(', ') + '.') - } + // unknown value + console.warn('Warning: Unknown value "' + options[name] + '" for configuration option "' + name + '". ' + + 'Available options: ' + values.map(value => JSON.stringify(value)).join(', ') + '.') } } diff --git a/src/core/function/deprecatedImport.js b/src/core/function/deprecatedImport.js deleted file mode 100644 index 022cff2552..0000000000 --- a/src/core/function/deprecatedImport.js +++ /dev/null @@ -1,12 +0,0 @@ - -export function createDeprecatedImport () { - return function deprecatedImport () { - throw new Error('The global import function is not available anymore in v6.0.0. \n' + - 'Please create a mathjs instance if you want to import functions. \n' + - 'Example:\n' + - '\n' + - ' import { create, all } from \'mathjs\';\n' + - ' const mathjs = create(all);\n' + - ' mathjs.import(...);\n') - } -} diff --git a/src/core/function/import.js b/src/core/function/import.js index d7c655fd55..b4a6a02b05 100644 --- a/src/core/function/import.js +++ b/src/core/function/import.js @@ -1,9 +1,8 @@ -import { isBigNumber, isComplex, isFraction, isMatrix, isUnit } from '../../utils/is' -import { isFactory, stripOptionalNotation } from '../../utils/factory' -import { hasOwnProperty, isLegacyFactory, lazy, traverse } from '../../utils/object' -import { contains } from '../../utils/array' -import { ArgumentsError } from '../../error/ArgumentsError' -import { warnOnce } from '../../utils/log' +import { isBigNumber, isComplex, isFraction, isMatrix, isUnit } from '../../utils/is.js' +import { isFactory, stripOptionalNotation } from '../../utils/factory.js' +import { hasOwnProperty, lazy } from '../../utils/object.js' +import { contains } from '../../utils/array.js' +import { ArgumentsError } from '../../error/ArgumentsError.js' export function importFactory (typed, load, math, importedFactories) { /** @@ -72,11 +71,7 @@ export function importFactory (typed, load, math, importedFactories) { } function flattenImports (flatValues, value, name) { - if (isLegacyFactory(value)) { - // legacy factories don't always have a name, - // let's not handle them via the new flatValues - _importLegacyFactory(value, options) - } else if (Array.isArray(value)) { + if (Array.isArray(value)) { value.forEach(item => flattenImports(flatValues, item)) } else if (typeof value === 'object') { for (const name in value) { @@ -232,85 +227,6 @@ export function importFactory (typed, load, math, importedFactories) { return wrapper } - /** - * Import an instance of a factory into math.js - * @param {{factory: Function, name: string, path: string, math: boolean}} factory - * @param {Object} options See import for a description of the options - * @private - */ - // TODO: _importLegacyFactory is deprecated since v6.0.0, clean up some day - function _importLegacyFactory (factory, options) { - warnOnce('Factories of type { name, factory } are deprecated since v6. ' + - 'Please create your factory functions using the math.factory function.') - - if (typeof factory.name === 'string') { - const name = factory.name - const existingTransform = name in math.expression.transform - const namespace = factory.path ? traverse(math, factory.path) : math - const existing = hasOwnProperty(namespace, name) ? namespace[name] : undefined - - const resolver = function () { - let instance = load(factory) - if (instance && typeof instance.transform === 'function') { - throw new Error('Transforms cannot be attached to factory functions. ' + - 'Please create a separate function for it with exports.path="expression.transform"') - } - - if (isTypedFunction(existing) && isTypedFunction(instance)) { - if (options.override) { - // replace the existing typed function (nothing to do) - } else { - // merge the existing and new typed function - instance = typed(existing, instance) - } - - return instance - } - - if (existing === undefined || options.override) { - return instance - } - - if (options.silent) { - return existing - } else { - throw new Error('Cannot import "' + name + '": already exists') - } - } - - if (factory.lazy !== false) { - lazy(namespace, name, resolver) - - if (existingTransform) { - _deleteTransform(name) - } else { - if (factory.path === 'expression.transform' || legacyFactoryAllowedInExpressions(factory)) { - lazy(math.expression.mathWithTransform, name, resolver) - } - } - } else { - namespace[name] = resolver() - - if (existingTransform) { - _deleteTransform(name) - } else { - if (factory.path === 'expression.transform' || legacyFactoryAllowedInExpressions(factory)) { - math.expression.mathWithTransform[name] = resolver() - } - } - } - - const key = factory.path ? (factory.path + '.' + factory.name) : factory.name - importedFactories[key] = factory - - math.emit('import', name, resolver, factory.path) - } else { - // unnamed factory. - // no lazy loading - load(factory) - } - } - /** * Import an instance of a factory into math.js * @param {function(scope: object)} factory @@ -445,10 +361,6 @@ export function importFactory (typed, load, math, importedFactories) { return !hasOwnProperty(unsafe, name) } - function legacyFactoryAllowedInExpressions (factory) { - return factory.path === undefined && !hasOwnProperty(unsafe, factory.name) - } - function factoryAllowedInExpressions (factory) { return factory.fn.indexOf('.') === -1 && // FIXME: make checking on path redundant, check on meta data instead !hasOwnProperty(unsafe, factory.fn) && diff --git a/src/core/function/typed.js b/src/core/function/typed.js index 883484aced..bedca7a904 100644 --- a/src/core/function/typed.js +++ b/src/core/function/typed.js @@ -74,10 +74,10 @@ import { isSymbolNode, isUndefined, isUnit -} from '../../utils/is' +} from '../../utils/is.js' import typedFunction from 'typed-function' -import { digits } from '../../utils/number' -import { factory } from '../../utils/factory' +import { digits } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' // returns a new instance of typed-function let _createTyped = function () { diff --git a/src/entry/allFactoriesAny.js b/src/entry/allFactoriesAny.js index 7eca7710c4..2d419aa96b 100644 --- a/src/entry/allFactoriesAny.js +++ b/src/entry/allFactoriesAny.js @@ -1,4 +1,4 @@ // creating all factories here in a separate file is needed to get tree-shaking working -import * as allFactories from '../factoriesAny' +import * as allFactories from '../factoriesAny.js' export const all = allFactories diff --git a/src/entry/allFactoriesNumber.js b/src/entry/allFactoriesNumber.js index e935f2ca55..111199d79d 100644 --- a/src/entry/allFactoriesNumber.js +++ b/src/entry/allFactoriesNumber.js @@ -1,4 +1,4 @@ // creating all factories here in a separate file is needed to get tree-shaking working -import * as allFactories from '../factoriesNumber' +import * as allFactories from '../factoriesNumber.js' export const all = allFactories diff --git a/src/entry/configReadonly.js b/src/entry/configReadonly.js index 4c950c45a6..47f8e61314 100644 --- a/src/entry/configReadonly.js +++ b/src/entry/configReadonly.js @@ -1,5 +1,5 @@ -import { DEFAULT_CONFIG } from '../core/config' -import { MATRIX_OPTIONS, NUMBER_OPTIONS } from '../core/function/config' +import { DEFAULT_CONFIG } from '../core/config.js' +import { MATRIX_OPTIONS, NUMBER_OPTIONS } from '../core/function/config.js' // create a read-only version of config export const config = /* #__PURE__ */ function (options) { diff --git a/src/entry/deprecatedAny.js b/src/entry/deprecatedAny.js deleted file mode 100644 index ac2ae5046a..0000000000 --- a/src/entry/deprecatedAny.js +++ /dev/null @@ -1,205 +0,0 @@ -// TODO: deprecated since version 6.0.0. Date: 2019-04-14 - -// "deprecatedEval" is also exposed as "eval" in the code compiled to ES5+CommonJs -import { createDeprecatedEval } from '../expression/function/eval' -import { createDeprecatedImport } from '../core/function/deprecatedImport' -import { createDeprecatedVar } from '../function/statistics/variance' -import { createDeprecatedTypeof } from '../function/utils/typeOf' -import { - isAccessorNode, - isArray, - isArrayNode, - isAssignmentNode, - isBigNumber, - isBlockNode, - isBoolean, isChain, isCollection, - isComplex, - isConditionalNode, - isConstantNode, - isDate, - isDenseMatrix, - isFraction, - isFunction, - isFunctionAssignmentNode, - isFunctionNode, - isHelp, - isIndex, - isIndexNode, - isMatrix, - isNode, - isNull, - isNumber, - isObject, - isObjectNode, - isOperatorNode, - isParenthesisNode, - isRange, - isRangeNode, - isRegExp, - isResultSet, - isSparseMatrix, - isString, isSymbolNode, - isUndefined, - isUnit -} from '../utils/is' -import { ArgumentsError } from '../error/ArgumentsError' -import { DimensionError } from '../error/DimensionError' -import { IndexError } from '../error/IndexError' -import { lazy } from '../utils/object' -import { warnOnce } from '../utils/log' -import { - BigNumber, - Complex, - DenseMatrix, - FibonacciHeap, - Fraction, - ImmutableDenseMatrix, - Index, - Matrix, - ResultSet, - Range, - Spa, - SparseMatrix, - typeOf, - Unit, - variance -} from './pureFunctionsAny.generated' -import { - AccessorNode, - ArrayNode, - AssignmentNode, - BlockNode, - Chain, - ConditionalNode, - ConstantNode, - evaluate, - FunctionAssignmentNode, - FunctionNode, - Help, - IndexNode, - Node, - ObjectNode, - OperatorNode, - ParenthesisNode, - parse, - Parser, - RangeNode, - RelationalNode, - reviver, - SymbolNode -} from './impureFunctionsAny.generated' - -export const deprecatedEval = /* #__PURE__ */ createDeprecatedEval({ evaluate }) - -// "deprecatedImport" is also exposed as "import" in the code compiled to ES5+CommonJs -export const deprecatedImport = /* #__PURE__ */ createDeprecatedImport({}) - -// "deprecatedVar" is also exposed as "var" in the code compiled to ES5+CommonJs -export const deprecatedVar = /* #__PURE__ */ createDeprecatedVar({ variance }) - -// "deprecatedTypeof" is also exposed as "typeof" in the code compiled to ES5+CommonJs -export const deprecatedTypeof = /* #__PURE__ */ createDeprecatedTypeof({ typeOf }) - -export const type = /* #__PURE__ */ createDeprecatedProperties('type', { - isNumber, - isComplex, - isBigNumber, - isFraction, - isUnit, - isString, - isArray, - isMatrix, - isCollection, - isDenseMatrix, - isSparseMatrix, - isRange, - isIndex, - isBoolean, - isResultSet, - isHelp, - isFunction, - isDate, - isRegExp, - isObject, - isNull, - isUndefined, - isAccessorNode, - isArrayNode, - isAssignmentNode, - isBlockNode, - isConditionalNode, - isConstantNode, - isFunctionAssignmentNode, - isFunctionNode, - isIndexNode, - isNode, - isObjectNode, - isOperatorNode, - isParenthesisNode, - isRangeNode, - isSymbolNode, - isChain, - BigNumber, - Chain, - Complex, - Fraction, - Matrix, - DenseMatrix, - SparseMatrix, - Spa, - FibonacciHeap, - ImmutableDenseMatrix, - Index, - Range, - ResultSet, - Unit, - Help, - Parser -}) - -export const expression = /* #__PURE__ */ createDeprecatedProperties('expression', { - parse, - Parser, - node: createDeprecatedProperties('expression.node', { - AccessorNode, - ArrayNode, - AssignmentNode, - BlockNode, - ConditionalNode, - ConstantNode, - IndexNode, - FunctionAssignmentNode, - FunctionNode, - Node, - ObjectNode, - OperatorNode, - ParenthesisNode, - RangeNode, - RelationalNode, - SymbolNode - }) -}) - -export const json = /* #__PURE__ */ createDeprecatedProperties('json', { - reviver -}) - -export const error = /* #__PURE__ */ createDeprecatedProperties('error', { - ArgumentsError, - DimensionError, - IndexError -}) - -function createDeprecatedProperties (path, props) { - const obj = {} - - Object.keys(props).forEach(name => { - lazy(obj, name, () => { - warnOnce(`math.${path}.${name} is moved to math.${name} in v6.0.0. ` + - 'Please use the new location instead.') - return props[name] - }) - }) - - return obj -} diff --git a/src/entry/mainAny.js b/src/entry/mainAny.js index aae54786af..ff1ce51495 100644 --- a/src/entry/mainAny.js +++ b/src/entry/mainAny.js @@ -1,25 +1,22 @@ // configuration -export { config } from './configReadonly' +export { config } from './configReadonly.js' // functions and constants -export * from './pureFunctionsAny.generated' -export * from './impureFunctionsAny.generated' -export * from './typeChecks' +export * from './pureFunctionsAny.generated.js' +export * from './impureFunctionsAny.generated.js' +export * from './typeChecks.js' // error classes -export { IndexError } from '../error/IndexError' -export { DimensionError } from '../error/DimensionError' -export { ArgumentsError } from '../error/ArgumentsError' +export { IndexError } from '../error/IndexError.js' +export { DimensionError } from '../error/DimensionError.js' +export { ArgumentsError } from '../error/ArgumentsError.js' // dependency groups -export * from './dependenciesAny.generated' +export * from './dependenciesAny.generated.js' // factory functions -export * from '../factoriesAny' +export * from '../factoriesAny.js' // core -export { create } from '../core/create' -export { factory } from '../utils/factory' - -// backward compatibility stuff for v5 -export * from './deprecatedAny' +export { create } from '../core/create.js' +export { factory } from '../utils/factory.js' diff --git a/src/entry/mainNumber.js b/src/entry/mainNumber.js index c8db5bee47..e54c4e5e23 100644 --- a/src/entry/mainNumber.js +++ b/src/entry/mainNumber.js @@ -1,22 +1,22 @@ // configuration -export { config } from './configReadonly' +export { config } from './configReadonly.js' // functions and constants -export * from './pureFunctionsNumber.generated' -export * from './impureFunctionsNumber.generated' -export * from './typeChecks' +export * from './pureFunctionsNumber.generated.js' +export * from './impureFunctionsNumber.generated.js' +export * from './typeChecks.js' // error classes -export { IndexError } from '../error/IndexError' -export { DimensionError } from '../error/DimensionError' -export { ArgumentsError } from '../error/ArgumentsError' +export { IndexError } from '../error/IndexError.js' +export { DimensionError } from '../error/DimensionError.js' +export { ArgumentsError } from '../error/ArgumentsError.js' // dependency groups -export * from './dependenciesNumber.generated' +export * from './dependenciesNumber.generated.js' // factory functions -export * from '../factoriesNumber' +export * from '../factoriesNumber.js' // core -export { create } from '../core/create' -export { factory } from '../utils/factory' +export { create } from '../core/create.js' +export { factory } from '../utils/factory.js' diff --git a/src/entry/typeChecks.js b/src/entry/typeChecks.js index 19367db495..4b188d762e 100644 --- a/src/entry/typeChecks.js +++ b/src/entry/typeChecks.js @@ -39,4 +39,4 @@ export { isSparseMatrix, isSymbolNode, isUnit -} from '../utils/is' +} from '../utils/is.js' diff --git a/src/error/deprecatedIndexFileError.js b/src/error/deprecatedIndexFileError.js deleted file mode 100644 index 3fa5e8251e..0000000000 --- a/src/error/deprecatedIndexFileError.js +++ /dev/null @@ -1,10 +0,0 @@ - -export function deprecatedIndexFileError (filename) { - const message = `The index file ${filename} is deprecated since v6.0.0. ` + - 'Please import and load individual files from the main index file instead, like: \n' + - ' \n' + - ' import { create, addDependencies, multiplyDependencies } from \'mathjs\' \n' + - ' const math = create({ addDependencies, multiplyDependencies }) \n' - - throw new Error(message) -} diff --git a/src/error/index.js b/src/error/index.js deleted file mode 100644 index a49e19ff4e..0000000000 --- a/src/error/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from './deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/expression/Help.js b/src/expression/Help.js index a0978ff67d..5b7e7e2b6d 100644 --- a/src/expression/Help.js +++ b/src/expression/Help.js @@ -1,7 +1,7 @@ -import { isHelp } from '../utils/is' -import { clone } from '../utils/object' -import { format } from '../utils/string' -import { factory } from '../utils/factory' +import { isHelp } from '../utils/is.js' +import { clone } from '../utils/object.js' +import { format } from '../utils/string.js' +import { factory } from '../utils/factory.js' const name = 'Help' const dependencies = ['parse'] @@ -99,11 +99,13 @@ export const createHelpClass = /* #__PURE__ */ factory(name, dependencies, ({ pa */ Help.fromJSON = function (json) { const doc = {} - for (const prop in json) { - if (prop !== 'mathjs') { // ignore mathjs field + + Object.keys(json) + .filter(prop => prop !== 'mathjs') + .forEach(prop => { doc[prop] = json[prop] - } - } + }) + return new Help(doc) } diff --git a/src/expression/Parser.js b/src/expression/Parser.js index 4f9b8986e3..74a3d34464 100644 --- a/src/expression/Parser.js +++ b/src/expression/Parser.js @@ -1,7 +1,6 @@ -import { factory } from '../utils/factory' -import { extend, hasOwnProperty } from '../utils/object' -import { getSafeProperty, setSafeProperty } from '../utils/customs' -import { warnOnce } from '../utils/log' +import { factory } from '../utils/factory.js' +import { extend, hasOwnProperty } from '../utils/object.js' +import { getSafeProperty, setSafeProperty } from '../utils/customs.js' const name = 'Parser' const dependencies = ['parse'] @@ -69,29 +68,6 @@ export const createParserClass = /* #__PURE__ */ factory(name, dependencies, ({ Parser.prototype.type = 'Parser' Parser.prototype.isParser = true - /** - * Parse an expression and return the parsed function node. - * The node tree can be compiled via `code = node.compile(math)`, - * and the compiled code can be executed as `code.evaluate([scope])` - * @param {string} expr - * @return {Node} node - * @throws {Error} - */ - Parser.prototype.parse = function (expr) { - throw new Error('Parser.parse is deprecated. Use math.parse instead.') - } - - /** - * Parse and compile an expression, return the compiled javascript code. - * The node can be evaluated via code.evaluate([scope]) - * @param {string} expr - * @return {{evaluate: function}} code - * @throws {Error} - */ - Parser.prototype.compile = function (expr) { - throw new Error('Parser.compile is deprecated. Use math.compile instead.') - } - /** * Parse and evaluate the given expression * @param {string} expr A string containing an expression, for example "2+3" @@ -105,19 +81,6 @@ export const createParserClass = /* #__PURE__ */ factory(name, dependencies, ({ .evaluate(this.scope) } - /** - * Parse and evaluate the given expression - * @param {string} expr A string containing an expression, for example "2+3" - * @return {*} result The result, or undefined when the expression was empty - * @throws {Error} - */ - // TODO: Deprecated since v6.0.0. Clean up some day - Parser.prototype.eval = function (expr) { - warnOnce('Method Parser.eval is renamed to Parser.evaluate. Please use the new method name.') - - return this.evaluate(expr) - } - /** * Get a variable (a function or variable) by name from the parsers scope. * Returns undefined when not found diff --git a/src/expression/embeddedDocs/embeddedDocs.js b/src/expression/embeddedDocs/embeddedDocs.js index 7fe696445b..a8de4208de 100644 --- a/src/expression/embeddedDocs/embeddedDocs.js +++ b/src/expression/embeddedDocs/embeddedDocs.js @@ -1,213 +1,214 @@ -import { bignumberDocs } from './construction/bignumber' -import { typeOfDocs } from './function/utils/typeOf' -import { isZeroDocs } from './function/utils/isZero' -import { isPrimeDocs } from './function/utils/isPrime' -import { isPositiveDocs } from './function/utils/isPositive' -import { isNumericDocs } from './function/utils/isNumeric' -import { hasNumericValueDocs } from './function/utils/hasNumericValue' -import { isNegativeDocs } from './function/utils/isNegative' -import { isIntegerDocs } from './function/utils/isInteger' -import { isNaNDocs } from './function/utils/isNaN' -import { formatDocs } from './function/utils/format' -import { cloneDocs } from './function/utils/clone' -import { toDocs } from './function/units/to' -import { tanhDocs } from './function/trigonometry/tanh' -import { tanDocs } from './function/trigonometry/tan' -import { sinhDocs } from './function/trigonometry/sinh' -import { sechDocs } from './function/trigonometry/sech' -import { secDocs } from './function/trigonometry/sec' -import { cschDocs } from './function/trigonometry/csch' -import { cscDocs } from './function/trigonometry/csc' -import { cothDocs } from './function/trigonometry/coth' -import { cotDocs } from './function/trigonometry/cot' -import { coshDocs } from './function/trigonometry/cosh' -import { cosDocs } from './function/trigonometry/cos' -import { atan2Docs } from './function/trigonometry/atan2' -import { atanhDocs } from './function/trigonometry/atanh' -import { atanDocs } from './function/trigonometry/atan' -import { asinhDocs } from './function/trigonometry/asinh' -import { asinDocs } from './function/trigonometry/asin' -import { asechDocs } from './function/trigonometry/asech' -import { asecDocs } from './function/trigonometry/asec' -import { acschDocs } from './function/trigonometry/acsch' -import { acscDocs } from './function/trigonometry/acsc' -import { acothDocs } from './function/trigonometry/acoth' -import { acotDocs } from './function/trigonometry/acot' -import { acoshDocs } from './function/trigonometry/acosh' -import { acosDocs } from './function/trigonometry/acos' -import { sumDocs } from './function/statistics/sum' -import { stdDocs } from './function/statistics/std' -import { quantileSeqDocs } from './function/statistics/quantileSeq' -import { prodDocs } from './function/statistics/prod' -import { modeDocs } from './function/statistics/mode' -import { minDocs } from './function/statistics/min' -import { medianDocs } from './function/statistics/median' -import { meanDocs } from './function/statistics/mean' -import { maxDocs } from './function/statistics/max' -import { madDocs } from './function/statistics/mad' -import { erfDocs } from './function/special/erf' -import { setUnionDocs } from './function/set/setUnion' -import { setSymDifferenceDocs } from './function/set/setSymDifference' -import { setSizeDocs } from './function/set/setSize' -import { setPowersetDocs } from './function/set/setPowerset' -import { setMultiplicityDocs } from './function/set/setMultiplicity' -import { setIsSubsetDocs } from './function/set/setIsSubset' -import { setIntersectDocs } from './function/set/setIntersect' -import { setDistinctDocs } from './function/set/setDistinct' -import { setDifferenceDocs } from './function/set/setDifference' -import { setCartesianDocs } from './function/set/setCartesian' -import { unequalDocs } from './function/relational/unequal' -import { smallerEqDocs } from './function/relational/smallerEq' -import { smallerDocs } from './function/relational/smaller' -import { largerEqDocs } from './function/relational/largerEq' -import { largerDocs } from './function/relational/larger' -import { equalTextDocs } from './function/relational/equalText' -import { equalDocs } from './function/relational/equal' -import { deepEqualDocs } from './function/relational/deepEqual' -import { compareTextDocs } from './function/relational/compareText' -import { compareNaturalDocs } from './function/relational/compareNatural' -import { compareDocs } from './function/relational/compare' -import { randomIntDocs } from './function/probability/randomInt' -import { randomDocs } from './function/probability/random' -import { pickRandomDocs } from './function/probability/pickRandom' -import { permutationsDocs } from './function/probability/permutations' -import { multinomialDocs } from './function/probability/multinomial' -import { kldivergenceDocs } from './function/probability/kldivergence' -import { gammaDocs } from './function/probability/gamma' -import { factorialDocs } from './function/probability/factorial' -import { combinationsDocs } from './function/probability/combinations' -import { combinationsWithRepDocs } from './function/probability/combinationsWithRep' -import { zerosDocs } from './function/matrix/zeros' -import { transposeDocs } from './function/matrix/transpose' -import { traceDocs } from './function/matrix/trace' -import { subsetDocs } from './function/matrix/subset' -import { squeezeDocs } from './function/matrix/squeeze' -import { sortDocs } from './function/matrix/sort' -import { sizeDocs } from './function/matrix/size' -import { reshapeDocs } from './function/matrix/reshape' -import { resizeDocs } from './function/matrix/resize' -import { rangeDocs } from './function/matrix/range' -import { partitionSelectDocs } from './function/matrix/partitionSelect' -import { onesDocs } from './function/matrix/ones' -import { mapDocs } from './function/matrix/map' -import { kronDocs } from './function/matrix/kron' -import { invDocs } from './function/matrix/inv' -import { forEachDocs } from './function/matrix/forEach' -import { flattenDocs } from './function/matrix/flatten' -import { filterDocs } from './function/matrix/filter' -import { identityDocs } from './function/matrix/identity' -import { getMatrixDataTypeDocs } from './function/matrix/getMatrixDataType' -import { dotDocs } from './function/matrix/dot' -import { diagDocs } from './function/matrix/diag' -import { detDocs } from './function/matrix/det' -import { ctransposeDocs } from './function/matrix/ctranspose' -import { crossDocs } from './function/matrix/cross' -import { concatDocs } from './function/matrix/concat' -import { xorDocs } from './function/logical/xor' -import { orDocs } from './function/logical/or' -import { notDocs } from './function/logical/not' -import { andDocs } from './function/logical/and' -import { intersectDocs } from './function/geometry/intersect' -import { distanceDocs } from './function/geometry/distance' -import { helpDocs } from './function/expression/help' -import { evaluateDocs } from './function/expression/evaluate' -import { imDocs } from './function/complex/im' -import { reDocs } from './function/complex/re' -import { conjDocs } from './function/complex/conj' -import { argDocs } from './function/complex/arg' -import { typedDocs } from './core/typed' -import { importDocs } from './core/import' -import { configDocs } from './core/config' -import { stirlingS2Docs } from './function/combinatorics/stirlingS2' -import { compositionDocs } from './function/combinatorics/composition' -import { catalanDocs } from './function/combinatorics/catalan' -import { bellNumbersDocs } from './function/combinatorics/bellNumbers' -import { rightLogShiftDocs } from './function/bitwise/rightLogShift' -import { rightArithShiftDocs } from './function/bitwise/rightArithShift' -import { leftShiftDocs } from './function/bitwise/leftShift' -import { bitXorDocs } from './function/bitwise/bitXor' -import { bitOrDocs } from './function/bitwise/bitOr' -import { bitNotDocs } from './function/bitwise/bitNot' -import { bitAndDocs } from './function/bitwise/bitAnd' -import { xgcdDocs } from './function/arithmetic/xgcd' -import { unaryPlusDocs } from './function/arithmetic/unaryPlus' -import { unaryMinusDocs } from './function/arithmetic/unaryMinus' -import { squareDocs } from './function/arithmetic/square' -import { sqrtmDocs } from './function/arithmetic/sqrtm' -import { sqrtDocs } from './function/arithmetic/sqrt' -import { signDocs } from './function/arithmetic/sign' -import { roundDocs } from './function/arithmetic/round' -import { powDocs } from './function/arithmetic/pow' -import { nthRootsDocs } from './function/arithmetic/nthRoots' -import { nthRootDocs } from './function/arithmetic/nthRoot' -import { normDocs } from './function/arithmetic/norm' -import { multiplyDocs } from './function/arithmetic/multiply' -import { modDocs } from './function/arithmetic/mod' -import { log10Docs } from './function/arithmetic/log10' -import { log1pDocs } from './function/arithmetic/log1p' -import { log2Docs } from './function/arithmetic/log2' -import { logDocs } from './function/arithmetic/log' -import { lcmDocs } from './function/arithmetic/lcm' -import { hypotDocs } from './function/arithmetic/hypot' -import { gcdDocs } from './function/arithmetic/gcd' -import { floorDocs } from './function/arithmetic/floor' -import { fixDocs } from './function/arithmetic/fix' -import { expm1Docs } from './function/arithmetic/expm1' -import { expmDocs } from './function/arithmetic/expm' -import { eigsDocs } from './function/matrix/eigs' -import { expDocs } from './function/arithmetic/exp' -import { dotMultiplyDocs } from './function/arithmetic/dotMultiply' -import { dotDivideDocs } from './function/arithmetic/dotDivide' -import { divideDocs } from './function/arithmetic/divide' -import { cubeDocs } from './function/arithmetic/cube' -import { ceilDocs } from './function/arithmetic/ceil' -import { cbrtDocs } from './function/arithmetic/cbrt' -import { addDocs } from './function/arithmetic/add' -import { absDocs } from './function/arithmetic/abs' -import { qrDocs } from './function/algebra/qr' -import { usolveDocs } from './function/algebra/usolve' -import { sluDocs } from './function/algebra/slu' -import { rationalizeDocs } from './function/algebra/rationalize' -import { simplifyDocs } from './function/algebra/simplify' -import { lupDocs } from './function/algebra/lup' -import { lsolveDocs } from './function/algebra/lsolve' -import { derivativeDocs } from './function/algebra/derivative' -import { versionDocs } from './constants/version' -import { trueDocs } from './constants/true' -import { tauDocs } from './constants/tau' -import { SQRT2Docs } from './constants/SQRT2' -import { SQRT12Docs } from './constants/SQRT1_2' -import { phiDocs } from './constants/phi' -import { piDocs } from './constants/pi' -import { nullDocs } from './constants/null' -import { NaNDocs } from './constants/NaN' -import { LOG10EDocs } from './constants/LOG10E' -import { LOG2EDocs } from './constants/LOG2E' -import { LN10Docs } from './constants/LN10' -import { LN2Docs } from './constants/LN2' -import { InfinityDocs } from './constants/Infinity' -import { iDocs } from './constants/i' -import { falseDocs } from './constants/false' -import { eDocs } from './constants/e' -import { unitDocs } from './construction/unit' -import { stringDocs } from './construction/string' -import { splitUnitDocs } from './construction/splitUnit' -import { sparseDocs } from './construction/sparse' -import { numberDocs } from './construction/number' -import { matrixDocs } from './construction/matrix' -import { indexDocs } from './construction' -import { fractionDocs } from './construction/fraction' -import { createUnitDocs } from './construction/createUnit' -import { complexDocs } from './construction/complex' -import { booleanDocs } from './construction/boolean' -import { dotPowDocs } from './function/arithmetic/dotPow' -import { lusolveDocs } from './function/algebra/lusolve' -import { subtractDocs } from './function/arithmetic/subtract' -import { varianceDocs } from './function/statistics/variance' -import { sinDocs } from './function/trigonometry/sin' -import { numericDocs } from './function/utils/numeric' -import { columnDocs } from './function/matrix/column' -import { rowDocs } from './function/matrix/row' +import { bignumberDocs } from './construction/bignumber.js' +import { typeOfDocs } from './function/utils/typeOf.js' +import { isZeroDocs } from './function/utils/isZero.js' +import { isPrimeDocs } from './function/utils/isPrime.js' +import { isPositiveDocs } from './function/utils/isPositive.js' +import { isNumericDocs } from './function/utils/isNumeric.js' +import { hasNumericValueDocs } from './function/utils/hasNumericValue.js' +import { isNegativeDocs } from './function/utils/isNegative.js' +import { isIntegerDocs } from './function/utils/isInteger.js' +import { isNaNDocs } from './function/utils/isNaN.js' +import { formatDocs } from './function/utils/format.js' +import { cloneDocs } from './function/utils/clone.js' +import { toDocs } from './function/units/to.js' +import { tanhDocs } from './function/trigonometry/tanh.js' +import { tanDocs } from './function/trigonometry/tan.js' +import { sinhDocs } from './function/trigonometry/sinh.js' +import { sechDocs } from './function/trigonometry/sech.js' +import { secDocs } from './function/trigonometry/sec.js' +import { cschDocs } from './function/trigonometry/csch.js' +import { cscDocs } from './function/trigonometry/csc.js' +import { cothDocs } from './function/trigonometry/coth.js' +import { cotDocs } from './function/trigonometry/cot.js' +import { coshDocs } from './function/trigonometry/cosh.js' +import { cosDocs } from './function/trigonometry/cos.js' +import { atan2Docs } from './function/trigonometry/atan2.js' +import { atanhDocs } from './function/trigonometry/atanh.js' +import { atanDocs } from './function/trigonometry/atan.js' +import { asinhDocs } from './function/trigonometry/asinh.js' +import { asinDocs } from './function/trigonometry/asin.js' +import { asechDocs } from './function/trigonometry/asech.js' +import { asecDocs } from './function/trigonometry/asec.js' +import { acschDocs } from './function/trigonometry/acsch.js' +import { acscDocs } from './function/trigonometry/acsc.js' +import { acothDocs } from './function/trigonometry/acoth.js' +import { acotDocs } from './function/trigonometry/acot.js' +import { acoshDocs } from './function/trigonometry/acosh.js' +import { acosDocs } from './function/trigonometry/acos.js' +import { sumDocs } from './function/statistics/sum.js' +import { stdDocs } from './function/statistics/std.js' +import { quantileSeqDocs } from './function/statistics/quantileSeq.js' +import { prodDocs } from './function/statistics/prod.js' +import { modeDocs } from './function/statistics/mode.js' +import { minDocs } from './function/statistics/min.js' +import { medianDocs } from './function/statistics/median.js' +import { meanDocs } from './function/statistics/mean.js' +import { maxDocs } from './function/statistics/max.js' +import { madDocs } from './function/statistics/mad.js' +import { erfDocs } from './function/special/erf.js' +import { setUnionDocs } from './function/set/setUnion.js' +import { setSymDifferenceDocs } from './function/set/setSymDifference.js' +import { setSizeDocs } from './function/set/setSize.js' +import { setPowersetDocs } from './function/set/setPowerset.js' +import { setMultiplicityDocs } from './function/set/setMultiplicity.js' +import { setIsSubsetDocs } from './function/set/setIsSubset.js' +import { setIntersectDocs } from './function/set/setIntersect.js' +import { setDistinctDocs } from './function/set/setDistinct.js' +import { setDifferenceDocs } from './function/set/setDifference.js' +import { setCartesianDocs } from './function/set/setCartesian.js' +import { unequalDocs } from './function/relational/unequal.js' +import { smallerEqDocs } from './function/relational/smallerEq.js' +import { smallerDocs } from './function/relational/smaller.js' +import { largerEqDocs } from './function/relational/largerEq.js' +import { largerDocs } from './function/relational/larger.js' +import { equalTextDocs } from './function/relational/equalText.js' +import { equalDocs } from './function/relational/equal.js' +import { deepEqualDocs } from './function/relational/deepEqual.js' +import { compareTextDocs } from './function/relational/compareText.js' +import { compareNaturalDocs } from './function/relational/compareNatural.js' +import { compareDocs } from './function/relational/compare.js' +import { randomIntDocs } from './function/probability/randomInt.js' +import { randomDocs } from './function/probability/random.js' +import { pickRandomDocs } from './function/probability/pickRandom.js' +import { permutationsDocs } from './function/probability/permutations.js' +import { multinomialDocs } from './function/probability/multinomial.js' +import { kldivergenceDocs } from './function/probability/kldivergence.js' +import { gammaDocs } from './function/probability/gamma.js' +import { factorialDocs } from './function/probability/factorial.js' +import { combinationsDocs } from './function/probability/combinations.js' +import { combinationsWithRepDocs } from './function/probability/combinationsWithRep.js' +import { zerosDocs } from './function/matrix/zeros.js' +import { transposeDocs } from './function/matrix/transpose.js' +import { traceDocs } from './function/matrix/trace.js' +import { subsetDocs } from './function/matrix/subset.js' +import { squeezeDocs } from './function/matrix/squeeze.js' +import { sortDocs } from './function/matrix/sort.js' +import { sizeDocs } from './function/matrix/size.js' +import { diffDocs } from './function/matrix/diff.js' +import { reshapeDocs } from './function/matrix/reshape.js' +import { resizeDocs } from './function/matrix/resize.js' +import { rangeDocs } from './function/matrix/range.js' +import { partitionSelectDocs } from './function/matrix/partitionSelect.js' +import { onesDocs } from './function/matrix/ones.js' +import { mapDocs } from './function/matrix/map.js' +import { kronDocs } from './function/matrix/kron.js' +import { invDocs } from './function/matrix/inv.js' +import { forEachDocs } from './function/matrix/forEach.js' +import { flattenDocs } from './function/matrix/flatten.js' +import { filterDocs } from './function/matrix/filter.js' +import { identityDocs } from './function/matrix/identity.js' +import { getMatrixDataTypeDocs } from './function/matrix/getMatrixDataType.js' +import { dotDocs } from './function/matrix/dot.js' +import { diagDocs } from './function/matrix/diag.js' +import { detDocs } from './function/matrix/det.js' +import { ctransposeDocs } from './function/matrix/ctranspose.js' +import { crossDocs } from './function/matrix/cross.js' +import { concatDocs } from './function/matrix/concat.js' +import { xorDocs } from './function/logical/xor.js' +import { orDocs } from './function/logical/or.js' +import { notDocs } from './function/logical/not.js' +import { andDocs } from './function/logical/and.js' +import { intersectDocs } from './function/geometry/intersect.js' +import { distanceDocs } from './function/geometry/distance.js' +import { helpDocs } from './function/expression/help.js' +import { evaluateDocs } from './function/expression/evaluate.js' +import { imDocs } from './function/complex/im.js' +import { reDocs } from './function/complex/re.js' +import { conjDocs } from './function/complex/conj.js' +import { argDocs } from './function/complex/arg.js' +import { typedDocs } from './core/typed.js' +import { importDocs } from './core/import.js' +import { configDocs } from './core/config.js' +import { stirlingS2Docs } from './function/combinatorics/stirlingS2.js' +import { compositionDocs } from './function/combinatorics/composition.js' +import { catalanDocs } from './function/combinatorics/catalan.js' +import { bellNumbersDocs } from './function/combinatorics/bellNumbers.js' +import { rightLogShiftDocs } from './function/bitwise/rightLogShift.js' +import { rightArithShiftDocs } from './function/bitwise/rightArithShift.js' +import { leftShiftDocs } from './function/bitwise/leftShift.js' +import { bitXorDocs } from './function/bitwise/bitXor.js' +import { bitOrDocs } from './function/bitwise/bitOr.js' +import { bitNotDocs } from './function/bitwise/bitNot.js' +import { bitAndDocs } from './function/bitwise/bitAnd.js' +import { xgcdDocs } from './function/arithmetic/xgcd.js' +import { unaryPlusDocs } from './function/arithmetic/unaryPlus.js' +import { unaryMinusDocs } from './function/arithmetic/unaryMinus.js' +import { squareDocs } from './function/arithmetic/square.js' +import { sqrtmDocs } from './function/arithmetic/sqrtm.js' +import { sqrtDocs } from './function/arithmetic/sqrt.js' +import { signDocs } from './function/arithmetic/sign.js' +import { roundDocs } from './function/arithmetic/round.js' +import { powDocs } from './function/arithmetic/pow.js' +import { nthRootsDocs } from './function/arithmetic/nthRoots.js' +import { nthRootDocs } from './function/arithmetic/nthRoot.js' +import { normDocs } from './function/arithmetic/norm.js' +import { multiplyDocs } from './function/arithmetic/multiply.js' +import { modDocs } from './function/arithmetic/mod.js' +import { log10Docs } from './function/arithmetic/log10.js' +import { log1pDocs } from './function/arithmetic/log1p.js' +import { log2Docs } from './function/arithmetic/log2.js' +import { logDocs } from './function/arithmetic/log.js' +import { lcmDocs } from './function/arithmetic/lcm.js' +import { hypotDocs } from './function/arithmetic/hypot.js' +import { gcdDocs } from './function/arithmetic/gcd.js' +import { floorDocs } from './function/arithmetic/floor.js' +import { fixDocs } from './function/arithmetic/fix.js' +import { expm1Docs } from './function/arithmetic/expm1.js' +import { expmDocs } from './function/arithmetic/expm.js' +import { eigsDocs } from './function/matrix/eigs.js' +import { expDocs } from './function/arithmetic/exp.js' +import { dotMultiplyDocs } from './function/arithmetic/dotMultiply.js' +import { dotDivideDocs } from './function/arithmetic/dotDivide.js' +import { divideDocs } from './function/arithmetic/divide.js' +import { cubeDocs } from './function/arithmetic/cube.js' +import { ceilDocs } from './function/arithmetic/ceil.js' +import { cbrtDocs } from './function/arithmetic/cbrt.js' +import { addDocs } from './function/arithmetic/add.js' +import { absDocs } from './function/arithmetic/abs.js' +import { qrDocs } from './function/algebra/qr.js' +import { usolveDocs } from './function/algebra/usolve.js' +import { sluDocs } from './function/algebra/slu.js' +import { rationalizeDocs } from './function/algebra/rationalize.js' +import { simplifyDocs } from './function/algebra/simplify.js' +import { lupDocs } from './function/algebra/lup.js' +import { lsolveDocs } from './function/algebra/lsolve.js' +import { derivativeDocs } from './function/algebra/derivative.js' +import { versionDocs } from './constants/version.js' +import { trueDocs } from './constants/true.js' +import { tauDocs } from './constants/tau.js' +import { SQRT2Docs } from './constants/SQRT2.js' +import { SQRT12Docs } from './constants/SQRT1_2.js' +import { phiDocs } from './constants/phi.js' +import { piDocs } from './constants/pi.js' +import { nullDocs } from './constants/null.js' +import { NaNDocs } from './constants/NaN.js' +import { LOG10EDocs } from './constants/LOG10E.js' +import { LOG2EDocs } from './constants/LOG2E.js' +import { LN10Docs } from './constants/LN10.js' +import { LN2Docs } from './constants/LN2.js' +import { InfinityDocs } from './constants/Infinity.js' +import { iDocs } from './constants/i.js' +import { falseDocs } from './constants/false.js' +import { eDocs } from './constants/e.js' +import { unitDocs } from './construction/unit.js' +import { stringDocs } from './construction/string.js' +import { splitUnitDocs } from './construction/splitUnit.js' +import { sparseDocs } from './construction/sparse.js' +import { numberDocs } from './construction/number.js' +import { matrixDocs } from './construction/matrix.js' +import { indexDocs } from './construction/index.js' +import { fractionDocs } from './construction/fraction.js' +import { createUnitDocs } from './construction/createUnit.js' +import { complexDocs } from './construction/complex.js' +import { booleanDocs } from './construction/boolean.js' +import { dotPowDocs } from './function/arithmetic/dotPow.js' +import { lusolveDocs } from './function/algebra/lusolve.js' +import { subtractDocs } from './function/arithmetic/subtract.js' +import { varianceDocs } from './function/statistics/variance.js' +import { sinDocs } from './function/trigonometry/sin.js' +import { numericDocs } from './function/utils/numeric.js' +import { columnDocs } from './function/matrix/column.js' +import { rowDocs } from './function/matrix/row.js' export const embeddedDocs = { @@ -383,7 +384,6 @@ export const embeddedDocs = { // functions - expression evaluate: evaluateDocs, - eval: evaluateDocs, // TODO: deprecated, cleanup in v7 help: helpDocs, // functions - geometry @@ -403,6 +403,7 @@ export const embeddedDocs = { ctranspose: ctransposeDocs, det: detDocs, diag: diagDocs, + diff: diffDocs, dot: dotDocs, getMatrixDataType: getMatrixDataTypeDocs, identity: identityDocs, @@ -480,7 +481,6 @@ export const embeddedDocs = { std: stdDocs, sum: sumDocs, variance: varianceDocs, - var: varianceDocs, // TODO: deprecated, cleanup in v7 // functions - trigonometry acos: acosDocs, @@ -525,6 +525,5 @@ export const embeddedDocs = { isZero: isZeroDocs, // print: printDocs // TODO: add documentation for print as soon as the parser supports objects. typeOf: typeOfDocs, - typeof: typeOfDocs, // TODO: deprecated, cleanup in v7 numeric: numericDocs } diff --git a/src/expression/embeddedDocs/function/matrix/diff.js b/src/expression/embeddedDocs/function/matrix/diff.js new file mode 100644 index 0000000000..21ebb66fa6 --- /dev/null +++ b/src/expression/embeddedDocs/function/matrix/diff.js @@ -0,0 +1,29 @@ +export const diffDocs = { + name: 'diff', + category: 'Matrix', + syntax: [ + 'diff(arr)', + 'diff(arr, dim)' + ], + description: [ + 'Create a new matrix or array with the difference of the passed matrix or array.', + 'Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference', + 'If no dimension parameter is passed it is assumed as dimension 0', + 'Dimension is zero-based in javascript and one-based in the parser', + 'Arrays must be \'rectangular\' meaning arrays like [1, 2]', + 'If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays' + ], + examples: [ + 'diff([1, 2, 4, 7, 0])', + 'diff([1, 2, 4, 7, 0], 0)', + 'diff(matrix([1, 2, 4, 7, 0]))', + 'diff([[1, 2], [3, 4]])', + 'diff([[1, 2], [3, 4]], 0)', + 'diff([[1, 2], [3, 4]], 1)', + 'diff([[1, 2], [3, 4]], bignumber(1))', + 'diff(matrix([[1, 2], [3, 4]]), 1)', + 'diff([[1, 2], matrix([3, 4])], 1)' + + ], + seealso: ['subtract', 'partitionSelect'] +} diff --git a/src/expression/function/compile.js b/src/expression/function/compile.js index 9a8ec4a711..a0e1d2f074 100644 --- a/src/expression/function/compile.js +++ b/src/expression/function/compile.js @@ -1,5 +1,5 @@ -import { deepMap } from '../../utils/collection' -import { factory } from '../../utils/factory' +import { deepMap } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' const name = 'compile' const dependencies = ['typed', 'parse'] diff --git a/src/expression/function/eval.js b/src/expression/function/eval.js deleted file mode 100644 index bf939e2fff..0000000000 --- a/src/expression/function/eval.js +++ /dev/null @@ -1,11 +0,0 @@ -// For backward compatibility, deprecated since version 6.0.0. Date: 2018-12-05 -import { factory } from '../../utils/factory' -import { warnOnce } from '../../utils/log' - -export const createDeprecatedEval = /* #__PURE__ */ factory('eval', ['evaluate'], ({ evaluate }) => { - return function (...args) { - warnOnce('Function "eval" has been renamed to "evaluate" in v6.0.0, please use the new function instead.') - - return evaluate.apply(evaluate, args) - } -}) diff --git a/src/expression/function/evaluate.js b/src/expression/function/evaluate.js index 7ad053c190..645e763614 100644 --- a/src/expression/function/evaluate.js +++ b/src/expression/function/evaluate.js @@ -1,5 +1,5 @@ -import { deepMap } from '../../utils/collection' -import { factory } from '../../utils/factory' +import { deepMap } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' const name = 'evaluate' const dependencies = ['typed', 'parse'] diff --git a/src/expression/function/help.js b/src/expression/function/help.js index e82c7bc97d..a6d3f3c831 100644 --- a/src/expression/function/help.js +++ b/src/expression/function/help.js @@ -1,7 +1,7 @@ -import { factory } from '../../utils/factory' -import { getSafeProperty } from '../../utils/customs' -import { embeddedDocs } from '../embeddedDocs/embeddedDocs' -import { hasOwnProperty } from '../../utils/object' +import { factory } from '../../utils/factory.js' +import { getSafeProperty } from '../../utils/customs.js' +import { embeddedDocs } from '../embeddedDocs/embeddedDocs.js' +import { hasOwnProperty } from '../../utils/object.js' const name = 'help' const dependencies = ['typed', 'mathWithTransform', 'Help'] diff --git a/src/expression/function/index.js b/src/expression/function/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/expression/function/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/expression/function/parse.js b/src/expression/function/parse.js deleted file mode 100644 index 3fdfff525b..0000000000 --- a/src/expression/function/parse.js +++ /dev/null @@ -1,3 +0,0 @@ -// TODO: deprecated since v6.0.0. Remove some day - -export { createParse } from '../parse' diff --git a/src/expression/function/parser.js b/src/expression/function/parser.js index 53b81aa66a..bfbcf61c77 100644 --- a/src/expression/function/parser.js +++ b/src/expression/function/parser.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'parser' const dependencies = ['typed', 'Parser'] diff --git a/src/expression/index.js b/src/expression/index.js deleted file mode 100644 index 54ef2a865b..0000000000 --- a/src/expression/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/expression/node/AccessorNode.js b/src/expression/node/AccessorNode.js index 990994b794..b5a63b9a37 100644 --- a/src/expression/node/AccessorNode.js +++ b/src/expression/node/AccessorNode.js @@ -8,10 +8,10 @@ import { isObjectNode, isParenthesisNode, isSymbolNode -} from '../../utils/is' -import { getSafeProperty } from '../../utils/customs' -import { factory } from '../../utils/factory' -import { accessFactory } from './utils/access' +} from '../../utils/is.js' +import { getSafeProperty } from '../../utils/customs.js' +import { factory } from '../../utils/factory.js' +import { accessFactory } from './utils/access.js' const name = 'AccessorNode' const dependencies = [ diff --git a/src/expression/node/ArrayNode.js b/src/expression/node/ArrayNode.js index 3b6ce3d287..d9614b3875 100644 --- a/src/expression/node/ArrayNode.js +++ b/src/expression/node/ArrayNode.js @@ -1,6 +1,6 @@ -import { isNode } from '../../utils/is' -import { map } from '../../utils/array' -import { factory } from '../../utils/factory' +import { isNode } from '../../utils/is.js' +import { map } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'ArrayNode' const dependencies = [ @@ -25,12 +25,6 @@ export const createArrayNode = /* #__PURE__ */ factory(name, dependencies, ({ No if (!Array.isArray(this.items) || !this.items.every(isNode)) { throw new TypeError('Array containing Nodes expected') } - - // TODO: deprecated since v3, remove some day - const deprecated = function () { - throw new Error('Property `ArrayNode.nodes` is deprecated, use `ArrayNode.items` instead') - } - Object.defineProperty(this, 'nodes', { get: deprecated, set: deprecated }) } ArrayNode.prototype = new Node() diff --git a/src/expression/node/AssignmentNode.js b/src/expression/node/AssignmentNode.js index 2cd1173f33..139bdb6905 100644 --- a/src/expression/node/AssignmentNode.js +++ b/src/expression/node/AssignmentNode.js @@ -1,9 +1,9 @@ -import { isAccessorNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is' -import { getSafeProperty, setSafeProperty } from '../../utils/customs' -import { factory } from '../../utils/factory' -import { accessFactory } from './utils/access' -import { assignFactory } from './utils/assign' -import { getPrecedence } from '../operators' +import { isAccessorNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js' +import { getSafeProperty, setSafeProperty } from '../../utils/customs.js' +import { factory } from '../../utils/factory.js' +import { accessFactory } from './utils/access.js' +import { assignFactory } from './utils/assign.js' +import { getPrecedence } from '../operators.js' const name = 'AssignmentNode' const dependencies = [ diff --git a/src/expression/node/BlockNode.js b/src/expression/node/BlockNode.js index 32730a5dd7..02cc4336ae 100644 --- a/src/expression/node/BlockNode.js +++ b/src/expression/node/BlockNode.js @@ -1,6 +1,6 @@ -import { isNode } from '../../utils/is' -import { forEach, map } from '../../utils/array' -import { factory } from '../../utils/factory' +import { isNode } from '../../utils/is.js' +import { forEach, map } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'BlockNode' const dependencies = [ diff --git a/src/expression/node/ConditionalNode.js b/src/expression/node/ConditionalNode.js index 5637c40627..8f0ead9221 100644 --- a/src/expression/node/ConditionalNode.js +++ b/src/expression/node/ConditionalNode.js @@ -1,6 +1,6 @@ -import { isBigNumber, isComplex, isNode, isUnit, typeOf } from '../../utils/is' -import { factory } from '../../utils/factory' -import { getPrecedence } from '../operators' +import { isBigNumber, isComplex, isNode, isUnit, typeOf } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' +import { getPrecedence } from '../operators.js' const name = 'ConditionalNode' const dependencies = [ diff --git a/src/expression/node/ConstantNode.js b/src/expression/node/ConstantNode.js index 7c98b19060..df20ed1219 100644 --- a/src/expression/node/ConstantNode.js +++ b/src/expression/node/ConstantNode.js @@ -1,7 +1,7 @@ -import { format } from '../../utils/string' -import { typeOf } from '../../utils/is' -import { escapeLatex } from '../../utils/latex' -import { factory } from '../../utils/factory' +import { format } from '../../utils/string.js' +import { typeOf } from '../../utils/is.js' +import { escapeLatex } from '../../utils/latex.js' +import { factory } from '../../utils/factory.js' const name = 'ConstantNode' const dependencies = [ @@ -26,11 +26,6 @@ export const createConstantNode = /* #__PURE__ */ factory(name, dependencies, ({ throw new SyntaxError('Constructor must be called with the new operator') } - if (arguments.length === 2) { - // TODO: remove deprecation error some day (created 2018-01-23) - throw new SyntaxError('new ConstantNode(valueStr, valueType) is not supported anymore since math v4.0.0. Use new ConstantNode(value) instead, where value is a non-stringified value.') - } - this.value = value } @@ -160,6 +155,12 @@ export const createConstantNode = /* #__PURE__ */ factory(name, dependencies, ({ case 'number': case 'BigNumber': { + if (!isFinite(this.value)) { + return (this.value.valueOf() < 0) + ? '-\\infty' + : '\\infty' + } + const index = value.toLowerCase().indexOf('e') if (index !== -1) { return value.substring(0, index) + '\\cdot10^{' + diff --git a/src/expression/node/FunctionAssignmentNode.js b/src/expression/node/FunctionAssignmentNode.js index 70f41e936e..5bc2a4e7ad 100644 --- a/src/expression/node/FunctionAssignmentNode.js +++ b/src/expression/node/FunctionAssignmentNode.js @@ -1,12 +1,12 @@ -import { isNode } from '../../utils/is' - -import { keywords } from '../keywords' -import { escape } from '../../utils/string' -import { forEach, join } from '../../utils/array' -import { toSymbol } from '../../utils/latex' -import { getPrecedence } from '../operators' -import { setSafeProperty } from '../../utils/customs' -import { factory } from '../../utils/factory' +import { isNode } from '../../utils/is.js' + +import { keywords } from '../keywords.js' +import { escape } from '../../utils/string.js' +import { forEach, join } from '../../utils/array.js' +import { toSymbol } from '../../utils/latex.js' +import { getPrecedence } from '../operators.js' +import { setSafeProperty } from '../../utils/customs.js' +import { factory } from '../../utils/factory.js' const name = 'FunctionAssignmentNode' const dependencies = [ diff --git a/src/expression/node/FunctionNode.js b/src/expression/node/FunctionNode.js index 8f646ecf3d..d860bfbfea 100644 --- a/src/expression/node/FunctionNode.js +++ b/src/expression/node/FunctionNode.js @@ -1,11 +1,11 @@ -import { isAccessorNode, isFunctionAssignmentNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is' +import { isAccessorNode, isFunctionAssignmentNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js' -import { escape } from '../../utils/string' -import { hasOwnProperty } from '../../utils/object' -import { map } from '../../utils/array' -import { getSafeProperty, validateSafeMethod } from '../../utils/customs' -import { factory } from '../../utils/factory' -import { defaultTemplate, latexFunctions } from '../../utils/latex' +import { escape } from '../../utils/string.js' +import { hasOwnProperty } from '../../utils/object.js' +import { map } from '../../utils/array.js' +import { getSafeProperty, validateSafeMethod } from '../../utils/customs.js' +import { factory } from '../../utils/factory.js' +import { defaultTemplate, latexFunctions } from '../../utils/latex.js' const name = 'FunctionNode' const dependencies = [ @@ -50,12 +50,6 @@ export const createFunctionNode = /* #__PURE__ */ factory(name, dependencies, ({ throw new Error('Cannot assign a new name, name is read-only') } }) - - // TODO: deprecated since v3, remove some day - const deprecated = function () { - throw new Error('Property `FunctionNode.object` is deprecated, use `FunctionNode.fn` instead') - } - Object.defineProperty(this, 'object', { get: deprecated, set: deprecated }) } FunctionNode.prototype = new Node() diff --git a/src/expression/node/IndexNode.js b/src/expression/node/IndexNode.js index 1a0cbaf90a..9d3cd092c5 100644 --- a/src/expression/node/IndexNode.js +++ b/src/expression/node/IndexNode.js @@ -1,8 +1,8 @@ -import { isBigNumber, isConstantNode, isNode, isRangeNode, isSymbolNode } from '../../utils/is' -import { map } from '../../utils/array' -import { escape } from '../../utils/string' -import { factory } from '../../utils/factory' -import { getSafeProperty } from '../../utils/customs' +import { isBigNumber, isConstantNode, isNode, isRangeNode, isSymbolNode } from '../../utils/is.js' +import { map } from '../../utils/array.js' +import { escape } from '../../utils/string.js' +import { factory } from '../../utils/factory.js' +import { getSafeProperty } from '../../utils/customs.js' const name = 'IndexNode' const dependencies = [ @@ -42,12 +42,6 @@ export const createIndexNode = /* #__PURE__ */ factory(name, dependencies, ({ Ra if (this.dotNotation && !this.isObjectProperty()) { throw new Error('dotNotation only applicable for object properties') } - - // TODO: deprecated since v3, remove some day - const deprecated = function () { - throw new Error('Property `IndexNode.object` is deprecated, use `IndexNode.fn` instead') - } - Object.defineProperty(this, 'object', { get: deprecated, set: deprecated }) } IndexNode.prototype = new Node() diff --git a/src/expression/node/Node.js b/src/expression/node/Node.js index dbd8625236..254a6915d5 100644 --- a/src/expression/node/Node.js +++ b/src/expression/node/Node.js @@ -1,9 +1,8 @@ -import { isNode } from '../../utils/is' +import { isNode } from '../../utils/is.js' -import { keywords } from '../keywords' -import { deepStrictEqual, hasOwnProperty } from '../../utils/object' -import { factory } from '../../utils/factory' -import { warnOnce } from '../../utils/log' +import { keywords } from '../keywords.js' +import { deepStrictEqual, hasOwnProperty } from '../../utils/object.js' +import { factory } from '../../utils/factory.js' const name = 'Node' const dependencies = ['mathWithTransform'] @@ -27,18 +26,6 @@ export const createNode = /* #__PURE__ */ factory(name, dependencies, ({ mathWit return this.compile().evaluate(scope) } - /** - * Evaluate the node - * @param {Object} [scope] Scope to read/write variables - * @return {*} Returns the result - */ - // TODO: Deprecated since v6.0.0. Clean up some day - Node.prototype.eval = function (scope) { - warnOnce('Method Node.eval is renamed to Node.evaluate. Please use the new method name.') - - return this.evaluate(scope) - } - Node.prototype.type = 'Node' Node.prototype.isNode = true @@ -65,14 +52,7 @@ export const createNode = /* #__PURE__ */ factory(name, dependencies, ({ mathWit } return { - evaluate, - - // TODO: Deprecated since v6.0.0. Clean up some day - eval: function deprecatedEval (scope) { - warnOnce('Method eval is renamed to evaluate. Please use the new method.') - - return evaluate(scope) - } + evaluate } } @@ -210,16 +190,6 @@ export const createNode = /* #__PURE__ */ factory(name, dependencies, ({ mathWit return nodes } - // TODO: deprecated since version 1.1.0, remove this some day - Node.prototype.find = function () { - throw new Error('Function Node.find is deprecated. Use Node.filter instead.') - } - - // TODO: deprecated since version 1.1.0, remove this some day - Node.prototype.match = function () { - throw new Error('Function Node.match is deprecated. See functions Node.filter, Node.transform, Node.traverse.') - } - /** * Create a shallow clone of this node * @return {Node} diff --git a/src/expression/node/ObjectNode.js b/src/expression/node/ObjectNode.js index fcec7663d9..5d6168252e 100644 --- a/src/expression/node/ObjectNode.js +++ b/src/expression/node/ObjectNode.js @@ -1,8 +1,8 @@ -import { isNode } from '../../utils/is' -import { escape, stringify } from '../../utils/string' -import { isSafeProperty } from '../../utils/customs' -import { hasOwnProperty } from '../../utils/object' -import { factory } from '../../utils/factory' +import { isNode } from '../../utils/is.js' +import { escape, stringify } from '../../utils/string.js' +import { isSafeProperty } from '../../utils/customs.js' +import { hasOwnProperty } from '../../utils/object.js' +import { factory } from '../../utils/factory.js' const name = 'ObjectNode' const dependencies = [ diff --git a/src/expression/node/OperatorNode.js b/src/expression/node/OperatorNode.js index 03dec4d1a9..43f6f00d3e 100644 --- a/src/expression/node/OperatorNode.js +++ b/src/expression/node/OperatorNode.js @@ -1,10 +1,10 @@ -import { isNode } from '../../utils/is' -import { map } from '../../utils/array' -import { escape } from '../../utils/string' -import { getSafeProperty, isSafeMethod } from '../../utils/customs' -import { getAssociativity, getPrecedence, isAssociativeWith, properties } from '../operators' -import { latexOperators } from '../../utils/latex' -import { factory } from '../../utils/factory' +import { isNode } from '../../utils/is.js' +import { map } from '../../utils/array.js' +import { escape } from '../../utils/string.js' +import { getSafeProperty, isSafeMethod } from '../../utils/customs.js' +import { getAssociativity, getPrecedence, isAssociativeWith, properties } from '../operators.js' +import { latexOperators } from '../../utils/latex.js' +import { factory } from '../../utils/factory.js' const name = 'OperatorNode' const dependencies = [ diff --git a/src/expression/node/ParenthesisNode.js b/src/expression/node/ParenthesisNode.js index 68cbe08d51..c59d4243cd 100644 --- a/src/expression/node/ParenthesisNode.js +++ b/src/expression/node/ParenthesisNode.js @@ -1,5 +1,5 @@ -import { isNode } from '../../utils/is' -import { factory } from '../../utils/factory' +import { isNode } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' const name = 'ParenthesisNode' const dependencies = [ diff --git a/src/expression/node/RangeNode.js b/src/expression/node/RangeNode.js index 2c91412494..849f7ba153 100644 --- a/src/expression/node/RangeNode.js +++ b/src/expression/node/RangeNode.js @@ -1,6 +1,6 @@ -import { isNode, isSymbolNode } from '../../utils/is' -import { factory } from '../../utils/factory' -import { getPrecedence } from '../operators' +import { isNode, isSymbolNode } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' +import { getPrecedence } from '../operators.js' const name = 'RangeNode' const dependencies = [ diff --git a/src/expression/node/RelationalNode.js b/src/expression/node/RelationalNode.js index ad68647b3b..80af63bb3c 100644 --- a/src/expression/node/RelationalNode.js +++ b/src/expression/node/RelationalNode.js @@ -1,8 +1,8 @@ -import { getPrecedence } from '../operators' -import { escape } from '../../utils/string' -import { getSafeProperty } from '../../utils/customs' -import { latexOperators } from '../../utils/latex' -import { factory } from '../../utils/factory' +import { getPrecedence } from '../operators.js' +import { escape } from '../../utils/string.js' +import { getSafeProperty } from '../../utils/customs.js' +import { latexOperators } from '../../utils/latex.js' +import { factory } from '../../utils/factory.js' const name = 'RelationalNode' const dependencies = [ diff --git a/src/expression/node/SymbolNode.js b/src/expression/node/SymbolNode.js index 18b1facc54..b3cc888641 100644 --- a/src/expression/node/SymbolNode.js +++ b/src/expression/node/SymbolNode.js @@ -1,7 +1,7 @@ -import { escape } from '../../utils/string' -import { getSafeProperty } from '../../utils/customs' -import { factory } from '../../utils/factory' -import { toSymbol } from '../../utils/latex' +import { escape } from '../../utils/string.js' +import { getSafeProperty } from '../../utils/customs.js' +import { factory } from '../../utils/factory.js' +import { toSymbol } from '../../utils/latex.js' const name = 'SymbolNode' const dependencies = [ diff --git a/src/expression/node/index.js b/src/expression/node/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/expression/node/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/expression/node/utils/access.js b/src/expression/node/utils/access.js index 447b6e4d42..5c87041965 100644 --- a/src/expression/node/utils/access.js +++ b/src/expression/node/utils/access.js @@ -1,5 +1,5 @@ -import { errorTransform } from '../../transform/utils/errorTransform' -import { getSafeProperty } from '../../../utils/customs' +import { errorTransform } from '../../transform/utils/errorTransform.js' +import { getSafeProperty } from '../../../utils/customs.js' export function accessFactory ({ subset }) { /** diff --git a/src/expression/node/utils/assign.js b/src/expression/node/utils/assign.js index 3629f49db8..b05c317818 100644 --- a/src/expression/node/utils/assign.js +++ b/src/expression/node/utils/assign.js @@ -1,5 +1,5 @@ -import { errorTransform } from '../../transform/utils/errorTransform' -import { setSafeProperty } from '../../../utils/customs' +import { errorTransform } from '../../transform/utils/errorTransform.js' +import { setSafeProperty } from '../../../utils/customs.js' export function assignFactory ({ subset, matrix }) { /** diff --git a/src/expression/operators.js b/src/expression/operators.js index 547abe8aac..4a3e380486 100644 --- a/src/expression/operators.js +++ b/src/expression/operators.js @@ -16,7 +16,7 @@ // left argument doesn't need to be enclosed // in parentheses // latexRightParens: the same for the right argument -import { hasOwnProperty } from '../utils/object' +import { hasOwnProperty } from '../utils/object.js' export const properties = [ { // assignment @@ -239,7 +239,7 @@ export function getPrecedence (_node, parenthesis) { * Returns a string containing 'left' or 'right' or null if * the associativity is not defined. * - * @param {Node} + * @param {Node} _node * @param {string} parenthesis * @return {string|null} * @throws {Error} diff --git a/src/expression/parse.js b/src/expression/parse.js index ba0ac49a12..2349048060 100644 --- a/src/expression/parse.js +++ b/src/expression/parse.js @@ -1,7 +1,7 @@ -import { factory } from '../utils/factory' -import { isAccessorNode, isConstantNode, isFunctionNode, isOperatorNode, isSymbolNode } from '../utils/is' -import { deepMap } from '../utils/collection' -import { hasOwnProperty } from '../utils/object' +import { factory } from '../utils/factory.js' +import { isAccessorNode, isConstantNode, isFunctionNode, isOperatorNode, isSymbolNode } from '../utils/is.js' +import { deepMap } from '../utils/collection.js' +import { hasOwnProperty } from '../utils/object.js' const name = 'parse' const dependencies = [ @@ -1163,7 +1163,7 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ * nodes in a custom way, for example for handling a plot. * * A handler must be passed as second argument of the parse function. - * - must extend math.expression.node.Node + * - must extend math.Node * - must contain a function _compile(defs: Object) : string * - must contain a function find(filter: Object) : Node[] * - must contain a function toString() : string @@ -1556,7 +1556,7 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ key = parseDoubleQuotesStringToken(state) } else if (state.token === '\'') { key = parseSingleQuotesStringToken(state) - } else if (state.tokenType === TOKENTYPE.SYMBOL) { + } else if (state.tokenType === TOKENTYPE.SYMBOL || (state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS)) { key = state.token getToken(state) } else { diff --git a/src/expression/transform/apply.transform.js b/src/expression/transform/apply.transform.js index 64acb605c7..49dcf88493 100644 --- a/src/expression/transform/apply.transform.js +++ b/src/expression/transform/apply.transform.js @@ -1,7 +1,7 @@ -import { errorTransform } from './utils/errorTransform' -import { factory } from '../../utils/factory' -import { createApply } from '../../function/matrix/apply' -import { isBigNumber, isNumber } from '../../utils/is' +import { errorTransform } from './utils/errorTransform.js' +import { factory } from '../../utils/factory.js' +import { createApply } from '../../function/matrix/apply.js' +import { isBigNumber, isNumber } from '../../utils/is.js' const name = 'apply' const dependencies = ['typed', 'isInteger'] diff --git a/src/expression/transform/column.transform.js b/src/expression/transform/column.transform.js index 9941ea43f4..1750d262de 100644 --- a/src/expression/transform/column.transform.js +++ b/src/expression/transform/column.transform.js @@ -1,7 +1,7 @@ -import { errorTransform } from './utils/errorTransform' -import { factory } from '../../utils/factory' -import { createColumn } from '../../function/matrix/column' -import { isNumber } from '../../utils/is' +import { errorTransform } from './utils/errorTransform.js' +import { factory } from '../../utils/factory.js' +import { createColumn } from '../../function/matrix/column.js' +import { isNumber } from '../../utils/is.js' const name = 'column' const dependencies = ['typed', 'Index', 'matrix', 'range'] diff --git a/src/expression/transform/concat.transform.js b/src/expression/transform/concat.transform.js index 5b39532d33..7102e7f051 100644 --- a/src/expression/transform/concat.transform.js +++ b/src/expression/transform/concat.transform.js @@ -1,7 +1,7 @@ -import { isBigNumber, isNumber } from '../../utils/is' -import { errorTransform } from './utils/errorTransform' -import { factory } from '../../utils/factory' -import { createConcat } from '../../function/matrix/concat' +import { isBigNumber, isNumber } from '../../utils/is.js' +import { errorTransform } from './utils/errorTransform.js' +import { factory } from '../../utils/factory.js' +import { createConcat } from '../../function/matrix/concat.js' const name = 'concat' const dependencies = ['typed', 'matrix', 'isInteger'] diff --git a/src/expression/transform/diff.transform.js b/src/expression/transform/diff.transform.js new file mode 100644 index 0000000000..0a6b9c884a --- /dev/null +++ b/src/expression/transform/diff.transform.js @@ -0,0 +1,37 @@ +import { isBigNumber, isCollection, isNumber } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' +import { errorTransform } from './utils/errorTransform.js' +import { createDiff } from '../../function/matrix/diff.js' + +const name = 'diff' +const dependencies = ['typed', 'matrix', 'subtract', 'number', 'bignumber'] + +export const createDiffTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, subtract, number, bignumber }) => { + const diff = createDiff({ typed, matrix, subtract, number, bignumber }) + + /** + * Attach a transform function to math.diff + * Adds a property transform containing the transform function. + * + * This transform creates a range which includes the end value + */ + return typed(name, { + '...any': function (args) { + // change last argument dim from one-based to zero-based + if (args.length === 2 && isCollection(args[0])) { + const dim = args[1] + if (isNumber(dim)) { + args[1] = dim - 1 + } else if (isBigNumber(dim)) { + args[1] = dim.minus(1) + } + } + + try { + return diff.apply(null, args) + } catch (err) { + throw errorTransform(err) + } + } + }) +}, { isTransformFunction: true }) diff --git a/src/expression/transform/filter.transform.js b/src/expression/transform/filter.transform.js index 039db2409f..285ceeec19 100644 --- a/src/expression/transform/filter.transform.js +++ b/src/expression/transform/filter.transform.js @@ -1,8 +1,8 @@ -import { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is' -import { filter, filterRegExp } from '../../utils/array' -import { maxArgumentCount } from '../../utils/function' -import { compileInlineExpression } from './utils/compileInlineExpression' -import { factory } from '../../utils/factory' +import { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js' +import { filter, filterRegExp } from '../../utils/array.js' +import { maxArgumentCount } from '../../utils/function.js' +import { compileInlineExpression } from './utils/compileInlineExpression.js' +import { factory } from '../../utils/factory.js' const name = 'filter' const dependencies = ['typed'] diff --git a/src/expression/transform/forEach.transform.js b/src/expression/transform/forEach.transform.js index da055ae3a8..873b1eb766 100644 --- a/src/expression/transform/forEach.transform.js +++ b/src/expression/transform/forEach.transform.js @@ -1,8 +1,8 @@ -import { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is' -import { maxArgumentCount } from '../../utils/function' -import { forEach } from '../../utils/array' -import { factory } from '../../utils/factory' -import { compileInlineExpression } from './utils/compileInlineExpression' +import { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js' +import { maxArgumentCount } from '../../utils/function.js' +import { forEach } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' +import { compileInlineExpression } from './utils/compileInlineExpression.js' const name = 'forEach' const dependencies = ['typed'] diff --git a/src/expression/transform/index.js b/src/expression/transform/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/expression/transform/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/expression/transform/index.transform.js b/src/expression/transform/index.transform.js index 1b09631047..1d6ea8eabd 100644 --- a/src/expression/transform/index.transform.js +++ b/src/expression/transform/index.transform.js @@ -1,5 +1,5 @@ -import { isArray, isBigNumber, isMatrix, isNumber, isRange } from '../../utils/is' -import { factory } from '../../utils/factory' +import { isArray, isBigNumber, isMatrix, isNumber, isRange } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' const name = 'index' const dependencies = ['Index'] diff --git a/src/expression/transform/map.transform.js b/src/expression/transform/map.transform.js index 104b58ceee..8ba712d9f6 100644 --- a/src/expression/transform/map.transform.js +++ b/src/expression/transform/map.transform.js @@ -1,8 +1,8 @@ -import { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is' -import { maxArgumentCount } from '../../utils/function' -import { map } from '../../utils/array' -import { factory } from '../../utils/factory' -import { compileInlineExpression } from './utils/compileInlineExpression' +import { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js' +import { maxArgumentCount } from '../../utils/function.js' +import { map } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' +import { compileInlineExpression } from './utils/compileInlineExpression.js' const name = 'map' const dependencies = ['typed'] diff --git a/src/expression/transform/max.transform.js b/src/expression/transform/max.transform.js index 01b986b052..a797105678 100644 --- a/src/expression/transform/max.transform.js +++ b/src/expression/transform/max.transform.js @@ -1,13 +1,13 @@ -import { isBigNumber, isCollection, isNumber } from '../../utils/is' -import { factory } from '../../utils/factory' -import { errorTransform } from './utils/errorTransform' -import { createMax } from '../../function/statistics/max' +import { isBigNumber, isCollection, isNumber } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' +import { errorTransform } from './utils/errorTransform.js' +import { createMax } from '../../function/statistics/max.js' const name = 'max' -const dependencies = ['typed', 'larger'] +const dependencies = ['typed', 'config', 'numeric', 'larger'] -export const createMaxTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, larger }) => { - const max = createMax({ typed, larger }) +export const createMaxTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, numeric, larger }) => { + const max = createMax({ typed, config, numeric, larger }) /** * Attach a transform function to math.max diff --git a/src/expression/transform/mean.transform.js b/src/expression/transform/mean.transform.js index 1d0b41f309..a0bf85f506 100644 --- a/src/expression/transform/mean.transform.js +++ b/src/expression/transform/mean.transform.js @@ -1,7 +1,7 @@ -import { isBigNumber, isCollection, isNumber } from '../../utils/is' -import { factory } from '../../utils/factory' -import { errorTransform } from './utils/errorTransform' -import { createMean } from '../../function/statistics/mean' +import { isBigNumber, isCollection, isNumber } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' +import { errorTransform } from './utils/errorTransform.js' +import { createMean } from '../../function/statistics/mean.js' const name = 'mean' const dependencies = ['typed', 'add', 'divide'] diff --git a/src/expression/transform/min.transform.js b/src/expression/transform/min.transform.js index 227c4d2ea2..a378af37d2 100644 --- a/src/expression/transform/min.transform.js +++ b/src/expression/transform/min.transform.js @@ -1,13 +1,13 @@ -import { isBigNumber, isCollection, isNumber } from '../../utils/is' -import { factory } from '../../utils/factory' -import { errorTransform } from './utils/errorTransform' -import { createMin } from '../../function/statistics/min' +import { isBigNumber, isCollection, isNumber } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' +import { errorTransform } from './utils/errorTransform.js' +import { createMin } from '../../function/statistics/min.js' const name = 'min' -const dependencies = ['typed', 'smaller'] +const dependencies = ['typed', 'config', 'numeric', 'smaller'] -export const createMinTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, smaller }) => { - const min = createMin({ typed, smaller }) +export const createMinTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, numeric, smaller }) => { + const min = createMin({ typed, config, numeric, smaller }) /** * Attach a transform function to math.min diff --git a/src/expression/transform/range.transform.js b/src/expression/transform/range.transform.js index 7ea67e1a7d..1f84435062 100644 --- a/src/expression/transform/range.transform.js +++ b/src/expression/transform/range.transform.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { createRange } from '../../function/matrix/range' +import { factory } from '../../utils/factory.js' +import { createRange } from '../../function/matrix/range.js' const name = 'range' const dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq'] diff --git a/src/expression/transform/row.transform.js b/src/expression/transform/row.transform.js index 5b6b1b9273..1be2783c81 100644 --- a/src/expression/transform/row.transform.js +++ b/src/expression/transform/row.transform.js @@ -1,7 +1,7 @@ -import { factory } from '../../utils/factory' -import { createRow } from '../../function/matrix/row' -import { errorTransform } from './utils/errorTransform' -import { isNumber } from '../../utils/is' +import { factory } from '../../utils/factory.js' +import { createRow } from '../../function/matrix/row.js' +import { errorTransform } from './utils/errorTransform.js' +import { isNumber } from '../../utils/is.js' const name = 'row' const dependencies = ['typed', 'Index', 'matrix', 'range'] diff --git a/src/expression/transform/std.transform.js b/src/expression/transform/std.transform.js index 1dd106603f..be6616bae2 100644 --- a/src/expression/transform/std.transform.js +++ b/src/expression/transform/std.transform.js @@ -1,7 +1,7 @@ -import { factory } from '../../utils/factory' -import { createStd } from '../../function/statistics/std' -import { isBigNumber, isNumber, isCollection } from '../../utils/is' -import { errorTransform } from './utils/errorTransform' +import { factory } from '../../utils/factory.js' +import { createStd } from '../../function/statistics/std.js' +import { isBigNumber, isNumber, isCollection } from '../../utils/is.js' +import { errorTransform } from './utils/errorTransform.js' const name = 'std' const dependencies = ['typed', 'sqrt', 'variance'] diff --git a/src/expression/transform/subset.transform.js b/src/expression/transform/subset.transform.js index c30f4c797c..84a089dd76 100644 --- a/src/expression/transform/subset.transform.js +++ b/src/expression/transform/subset.transform.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { errorTransform } from './utils/errorTransform' -import { createSubset } from '../../function/matrix/subset' +import { factory } from '../../utils/factory.js' +import { errorTransform } from './utils/errorTransform.js' +import { createSubset } from '../../function/matrix/subset.js' const name = 'subset' const dependencies = ['typed', 'matrix'] diff --git a/src/expression/transform/sum.transform.js b/src/expression/transform/sum.transform.js index 4ebe8695e3..36729e6084 100644 --- a/src/expression/transform/sum.transform.js +++ b/src/expression/transform/sum.transform.js @@ -1,7 +1,7 @@ -import { isBigNumber, isCollection, isNumber } from '../../utils/is' -import { factory } from '../../utils/factory' -import { errorTransform } from './utils/errorTransform' -import { createSum } from '../../function/statistics/sum' +import { isBigNumber, isCollection, isNumber } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' +import { errorTransform } from './utils/errorTransform.js' +import { createSum } from '../../function/statistics/sum.js' /** * Attach a transform function to math.sum @@ -11,10 +11,10 @@ import { createSum } from '../../function/statistics/sum' * from one-based to zero based */ const name = 'sum' -const dependencies = ['typed', 'config', 'add', '?bignumber', '?fraction'] +const dependencies = ['typed', 'config', 'add', 'numeric'] -export const createSumTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, add, bignumber, fraction }) => { - const sum = createSum({ typed, config, add, bignumber, fraction }) +export const createSumTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, add, numeric }) => { + const sum = createSum({ typed, config, add, numeric }) return typed(name, { '...any': function (args) { diff --git a/src/expression/transform/utils/compileInlineExpression.js b/src/expression/transform/utils/compileInlineExpression.js index 1aa247303c..b39d63d913 100644 --- a/src/expression/transform/utils/compileInlineExpression.js +++ b/src/expression/transform/utils/compileInlineExpression.js @@ -1,4 +1,4 @@ -import { isSymbolNode } from '../../../utils/is' +import { isSymbolNode } from '../../../utils/is.js' /** * Compile an inline expression like "x > 0" diff --git a/src/expression/transform/utils/errorTransform.js b/src/expression/transform/utils/errorTransform.js index e5a2c4000e..b1d90df7c3 100644 --- a/src/expression/transform/utils/errorTransform.js +++ b/src/expression/transform/utils/errorTransform.js @@ -1,4 +1,4 @@ -import { IndexError } from '../../../error/IndexError' +import { IndexError } from '../../../error/IndexError.js' /** * Transform zero-based indices to one-based indices in errors diff --git a/src/expression/transform/variance.transform.js b/src/expression/transform/variance.transform.js index 740f361c32..212320aa90 100644 --- a/src/expression/transform/variance.transform.js +++ b/src/expression/transform/variance.transform.js @@ -1,7 +1,7 @@ -import { factory } from '../../utils/factory' -import { isBigNumber, isCollection, isNumber } from '../../utils/is' -import { errorTransform } from './utils/errorTransform' -import { createVariance } from '../../function/statistics/variance' +import { factory } from '../../utils/factory.js' +import { isBigNumber, isCollection, isNumber } from '../../utils/is.js' +import { errorTransform } from './utils/errorTransform.js' +import { createVariance } from '../../function/statistics/variance.js' const name = 'variance' const dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN'] diff --git a/src/factoriesAny.js b/src/factoriesAny.js index b144bbc976..99e59defac 100644 --- a/src/factoriesAny.js +++ b/src/factoriesAny.js @@ -1,239 +1,239 @@ -export { createTyped } from './core/function/typed' -export { createResultSet } from './type/resultset/ResultSet' -export { createBigNumberClass } from './type/bignumber/BigNumber' -export { createComplexClass } from './type/complex/Complex' -export { createFractionClass } from './type/fraction/Fraction' -export { createRangeClass } from './type/matrix/Range' -export { createMatrixClass } from './type/matrix/Matrix' -export { createDenseMatrixClass } from './type/matrix/DenseMatrix' -export { createClone } from './function/utils/clone' -export { createIsInteger } from './function/utils/isInteger' -export { createIsNegative } from './function/utils/isNegative' -export { createIsNumeric } from './function/utils/isNumeric' -export { createHasNumericValue } from './function/utils/hasNumericValue' -export { createIsPositive } from './function/utils/isPositive' -export { createIsZero } from './function/utils/isZero' -export { createIsNaN } from './function/utils/isNaN' -export { createTypeOf, createDeprecatedTypeof } from './function/utils/typeOf' -export { createEqualScalar } from './function/relational/equalScalar' -export { createSparseMatrixClass } from './type/matrix/SparseMatrix' -export { createNumber } from './type/number' -export { createString } from './type/string' -export { createBoolean } from './type/boolean' -export { createBignumber } from './type/bignumber/function/bignumber' -export { createComplex } from './type/complex/function/complex' -export { createFraction } from './type/fraction/function/fraction' -export { createMatrix } from './type/matrix/function/matrix' -export { createSplitUnit } from './type/unit/function/splitUnit' -export { createUnaryMinus } from './function/arithmetic/unaryMinus' -export { createUnaryPlus } from './function/arithmetic/unaryPlus' -export { createAbs } from './function/arithmetic/abs' -export { createApply } from './function/matrix/apply' -export { createAddScalar } from './function/arithmetic/addScalar' -export { createCbrt } from './function/arithmetic/cbrt' -export { createCeil } from './function/arithmetic/ceil' -export { createCube } from './function/arithmetic/cube' -export { createExp } from './function/arithmetic/exp' -export { createExpm1 } from './function/arithmetic/expm1' -export { createFix } from './function/arithmetic/fix' -export { createFloor } from './function/arithmetic/floor' -export { createGcd } from './function/arithmetic/gcd' -export { createLcm } from './function/arithmetic/lcm' -export { createLog10 } from './function/arithmetic/log10' -export { createLog2 } from './function/arithmetic/log2' -export { createMod } from './function/arithmetic/mod' -export { createMultiplyScalar } from './function/arithmetic/multiplyScalar' -export { createMultiply } from './function/arithmetic/multiply' -export { createNthRoot } from './function/arithmetic/nthRoot' -export { createSign } from './function/arithmetic/sign' -export { createSqrt } from './function/arithmetic/sqrt' -export { createSquare } from './function/arithmetic/square' -export { createSubtract } from './function/arithmetic/subtract' -export { createXgcd } from './function/arithmetic/xgcd' -export { createDotMultiply } from './function/arithmetic/dotMultiply' -export { createBitAnd } from './function/bitwise/bitAnd' -export { createBitNot } from './function/bitwise/bitNot' -export { createBitOr } from './function/bitwise/bitOr' -export { createBitXor } from './function/bitwise/bitXor' -export { createArg } from './function/complex/arg' -export { createConj } from './function/complex/conj' -export { createIm } from './function/complex/im' -export { createRe } from './function/complex/re' -export { createNot } from './function/logical/not' -export { createOr } from './function/logical/or' -export { createXor } from './function/logical/xor' -export { createConcat } from './function/matrix/concat' -export { createColumn } from './function/matrix/column' -export { createCross } from './function/matrix/cross' -export { createDiag } from './function/matrix/diag' -export { createEye } from './function/matrix/eye' -export { createFilter } from './function/matrix/filter' -export { createFlatten } from './function/matrix/flatten' -export { createForEach } from './function/matrix/forEach' -export { createGetMatrixDataType } from './function/matrix/getMatrixDataType' -export { createIdentity } from './function/matrix/identity' -export { createKron } from './function/matrix/kron' -export { createMap } from './function/matrix/map' -export { createOnes } from './function/matrix/ones' -export { createRange } from './function/matrix/range' -export { createReshape } from './function/matrix/reshape' -export { createResize } from './function/matrix/resize' -export { createRow } from './function/matrix/row' -export { createSize } from './function/matrix/size' -export { createSqueeze } from './function/matrix/squeeze' -export { createSubset } from './function/matrix/subset' -export { createTranspose } from './function/matrix/transpose' -export { createCtranspose } from './function/matrix/ctranspose' -export { createZeros } from './function/matrix/zeros' -export { createErf } from './function/special/erf' -export { createMode } from './function/statistics/mode' -export { createProd } from './function/statistics/prod' -export { createFormat } from './function/string/format' -export { createPrint } from './function/string/print' -export { createTo } from './function/unit/to' -export { createIsPrime } from './function/utils/isPrime' -export { createNumeric } from './function/utils/numeric' -export { createDivideScalar } from './function/arithmetic/divideScalar' -export { createPow } from './function/arithmetic/pow' -export { createRound } from './function/arithmetic/round' -export { createLog } from './function/arithmetic/log' -export { createLog1p } from './function/arithmetic/log1p' -export { createNthRoots } from './function/arithmetic/nthRoots' -export { createDotPow } from './function/arithmetic/dotPow' -export { createDotDivide } from './function/arithmetic/dotDivide' -export { createLsolve } from './function/algebra/solver/lsolve' -export { createUsolve } from './function/algebra/solver/usolve' -export { createLeftShift } from './function/bitwise/leftShift' -export { createRightArithShift } from './function/bitwise/rightArithShift' -export { createRightLogShift } from './function/bitwise/rightLogShift' -export { createAnd } from './function/logical/and' -export { createCompare } from './function/relational/compare' -export { createCompareNatural } from './function/relational/compareNatural' -export { createCompareText } from './function/relational/compareText' -export { createEqual } from './function/relational/equal' -export { createEqualText } from './function/relational/equalText' -export { createSmaller } from './function/relational/smaller' -export { createSmallerEq } from './function/relational/smallerEq' -export { createLarger } from './function/relational/larger' -export { createLargerEq } from './function/relational/largerEq' -export { createDeepEqual } from './function/relational/deepEqual' -export { createUnequal } from './function/relational/unequal' -export { createPartitionSelect } from './function/matrix/partitionSelect' -export { createSort } from './function/matrix/sort' -export { createMax } from './function/statistics/max' -export { createMin } from './function/statistics/min' -export { createImmutableDenseMatrixClass } from './type/matrix/ImmutableDenseMatrix' -export { createIndexClass } from './type/matrix/MatrixIndex' -export { createFibonacciHeapClass } from './type/matrix/FibonacciHeap' -export { createSpaClass } from './type/matrix/Spa' -export { createUnitClass } from './type/unit/Unit' -export { createUnitFunction } from './type/unit/function/unit' -export { createSparse } from './type/matrix/function/sparse' -export { createCreateUnit } from './type/unit/function/createUnit' -export { createAcos } from './function/trigonometry/acos' -export { createAcosh } from './function/trigonometry/acosh' -export { createAcot } from './function/trigonometry/acot' -export { createAcoth } from './function/trigonometry/acoth' -export { createAcsc } from './function/trigonometry/acsc' -export { createAcsch } from './function/trigonometry/acsch' -export { createAsec } from './function/trigonometry/asec' -export { createAsech } from './function/trigonometry/asech' -export { createAsin } from './function/trigonometry/asin' -export { createAsinh } from './function/trigonometry/asinh' -export { createAtan } from './function/trigonometry/atan' -export { createAtan2 } from './function/trigonometry/atan2' -export { createAtanh } from './function/trigonometry/atanh' -export { createCos } from './function/trigonometry/cos' -export { createCosh } from './function/trigonometry/cosh' -export { createCot } from './function/trigonometry/cot' -export { createCoth } from './function/trigonometry/coth' -export { createCsc } from './function/trigonometry/csc' -export { createCsch } from './function/trigonometry/csch' -export { createSec } from './function/trigonometry/sec' -export { createSech } from './function/trigonometry/sech' -export { createSin } from './function/trigonometry/sin' -export { createSinh } from './function/trigonometry/sinh' -export { createTan } from './function/trigonometry/tan' -export { createTanh } from './function/trigonometry/tanh' -export { createSetCartesian } from './function/set/setCartesian' -export { createSetDifference } from './function/set/setDifference' -export { createSetDistinct } from './function/set/setDistinct' -export { createSetIntersect } from './function/set/setIntersect' -export { createSetIsSubset } from './function/set/setIsSubset' -export { createSetMultiplicity } from './function/set/setMultiplicity' -export { createSetPowerset } from './function/set/setPowerset' -export { createSetSize } from './function/set/setSize' -export { createSetSymDifference } from './function/set/setSymDifference' -export { createSetUnion } from './function/set/setUnion' -export { createAdd } from './function/arithmetic/add' -export { createHypot } from './function/arithmetic/hypot' -export { createNorm } from './function/arithmetic/norm' -export { createDot } from './function/matrix/dot' -export { createTrace } from './function/matrix/trace' -export { createIndex } from './type/matrix/function' -export { createNode } from './expression/node/Node' -export { createAccessorNode } from './expression/node/AccessorNode' -export { createArrayNode } from './expression/node/ArrayNode' -export { createAssignmentNode } from './expression/node/AssignmentNode' -export { createBlockNode } from './expression/node/BlockNode' -export { createConditionalNode } from './expression/node/ConditionalNode' -export { createConstantNode } from './expression/node/ConstantNode' -export { createFunctionAssignmentNode } from './expression/node/FunctionAssignmentNode' -export { createIndexNode } from './expression/node/IndexNode' -export { createObjectNode } from './expression/node/ObjectNode' -export { createOperatorNode } from './expression/node/OperatorNode' -export { createParenthesisNode } from './expression/node/ParenthesisNode' -export { createRangeNode } from './expression/node/RangeNode' -export { createRelationalNode } from './expression/node/RelationalNode' -export { createSymbolNode } from './expression/node/SymbolNode' -export { createFunctionNode } from './expression/node/FunctionNode' -export { createParse } from './expression/parse' -export { createCompile } from './expression/function/compile' -export { createEvaluate } from './expression/function/evaluate' -export { createDeprecatedEval } from './expression/function/eval' -export { createParserClass } from './expression/Parser' -export { createParser } from './expression/function/parser' -export { createLup } from './function/algebra/decomposition/lup' -export { createQr } from './function/algebra/decomposition/qr' -export { createSlu } from './function/algebra/decomposition/slu' -export { createLusolve } from './function/algebra/solver/lusolve' -export { createHelpClass } from './expression/Help' -export { createChainClass } from './type/chain/Chain' -export { createHelp } from './expression/function/help' -export { createChain } from './type/chain/function/chain' -export { createDet } from './function/matrix/det' -export { createInv } from './function/matrix/inv' -export { createEigs } from './function/matrix/eigs' -export { createExpm } from './function/matrix/expm' -export { createSqrtm } from './function/matrix/sqrtm' -export { createDivide } from './function/arithmetic/divide' -export { createDistance } from './function/geometry/distance' -export { createIntersect } from './function/geometry/intersect' -export { createSum } from './function/statistics/sum' -export { createMean } from './function/statistics/mean' -export { createMedian } from './function/statistics/median' -export { createMad } from './function/statistics/mad' -export { createVariance, createDeprecatedVar } from './function/statistics/variance' -export { createQuantileSeq } from './function/statistics/quantileSeq' -export { createStd } from './function/statistics/std' -export { createCombinations } from './function/probability/combinations' -export { createCombinationsWithRep } from './function/probability/combinationsWithRep' -export { createGamma } from './function/probability/gamma' -export { createFactorial } from './function/probability/factorial' -export { createKldivergence } from './function/probability/kldivergence' -export { createMultinomial } from './function/probability/multinomial' -export { createPermutations } from './function/probability/permutations' -export { createPickRandom } from './function/probability/pickRandom' -export { createRandom } from './function/probability/random' -export { createRandomInt } from './function/probability/randomInt' -export { createStirlingS2 } from './function/combinatorics/stirlingS2' -export { createBellNumbers } from './function/combinatorics/bellNumbers' -export { createCatalan } from './function/combinatorics/catalan' -export { createComposition } from './function/combinatorics/composition' -export { createSimplify } from './function/algebra/simplify' -export { createDerivative } from './function/algebra/derivative' -export { createRationalize } from './function/algebra/rationalize' -export { createReviver } from './json/reviver' +export { createTyped } from './core/function/typed.js' +export { createResultSet } from './type/resultset/ResultSet.js' +export { createBigNumberClass } from './type/bignumber/BigNumber.js' +export { createComplexClass } from './type/complex/Complex.js' +export { createFractionClass } from './type/fraction/Fraction.js' +export { createRangeClass } from './type/matrix/Range.js' +export { createMatrixClass } from './type/matrix/Matrix.js' +export { createDenseMatrixClass } from './type/matrix/DenseMatrix.js' +export { createClone } from './function/utils/clone.js' +export { createIsInteger } from './function/utils/isInteger.js' +export { createIsNegative } from './function/utils/isNegative.js' +export { createIsNumeric } from './function/utils/isNumeric.js' +export { createHasNumericValue } from './function/utils/hasNumericValue.js' +export { createIsPositive } from './function/utils/isPositive.js' +export { createIsZero } from './function/utils/isZero.js' +export { createIsNaN } from './function/utils/isNaN.js' +export { createTypeOf } from './function/utils/typeOf.js' +export { createEqualScalar } from './function/relational/equalScalar.js' +export { createSparseMatrixClass } from './type/matrix/SparseMatrix.js' +export { createNumber } from './type/number.js' +export { createString } from './type/string.js' +export { createBoolean } from './type/boolean.js' +export { createBignumber } from './type/bignumber/function/bignumber.js' +export { createComplex } from './type/complex/function/complex.js' +export { createFraction } from './type/fraction/function/fraction.js' +export { createMatrix } from './type/matrix/function/matrix.js' +export { createSplitUnit } from './type/unit/function/splitUnit.js' +export { createUnaryMinus } from './function/arithmetic/unaryMinus.js' +export { createUnaryPlus } from './function/arithmetic/unaryPlus.js' +export { createAbs } from './function/arithmetic/abs.js' +export { createApply } from './function/matrix/apply.js' +export { createAddScalar } from './function/arithmetic/addScalar.js' +export { createCbrt } from './function/arithmetic/cbrt.js' +export { createCeil } from './function/arithmetic/ceil.js' +export { createCube } from './function/arithmetic/cube.js' +export { createExp } from './function/arithmetic/exp.js' +export { createExpm1 } from './function/arithmetic/expm1.js' +export { createFix } from './function/arithmetic/fix.js' +export { createFloor } from './function/arithmetic/floor.js' +export { createGcd } from './function/arithmetic/gcd.js' +export { createLcm } from './function/arithmetic/lcm.js' +export { createLog10 } from './function/arithmetic/log10.js' +export { createLog2 } from './function/arithmetic/log2.js' +export { createMod } from './function/arithmetic/mod.js' +export { createMultiplyScalar } from './function/arithmetic/multiplyScalar.js' +export { createMultiply } from './function/arithmetic/multiply.js' +export { createNthRoot } from './function/arithmetic/nthRoot.js' +export { createSign } from './function/arithmetic/sign.js' +export { createSqrt } from './function/arithmetic/sqrt.js' +export { createSquare } from './function/arithmetic/square.js' +export { createSubtract } from './function/arithmetic/subtract.js' +export { createXgcd } from './function/arithmetic/xgcd.js' +export { createDotMultiply } from './function/arithmetic/dotMultiply.js' +export { createBitAnd } from './function/bitwise/bitAnd.js' +export { createBitNot } from './function/bitwise/bitNot.js' +export { createBitOr } from './function/bitwise/bitOr.js' +export { createBitXor } from './function/bitwise/bitXor.js' +export { createArg } from './function/complex/arg.js' +export { createConj } from './function/complex/conj.js' +export { createIm } from './function/complex/im.js' +export { createRe } from './function/complex/re.js' +export { createNot } from './function/logical/not.js' +export { createOr } from './function/logical/or.js' +export { createXor } from './function/logical/xor.js' +export { createConcat } from './function/matrix/concat.js' +export { createColumn } from './function/matrix/column.js' +export { createCross } from './function/matrix/cross.js' +export { createDiag } from './function/matrix/diag.js' +export { createFilter } from './function/matrix/filter.js' +export { createFlatten } from './function/matrix/flatten.js' +export { createForEach } from './function/matrix/forEach.js' +export { createGetMatrixDataType } from './function/matrix/getMatrixDataType.js' +export { createIdentity } from './function/matrix/identity.js' +export { createKron } from './function/matrix/kron.js' +export { createMap } from './function/matrix/map.js' +export { createDiff } from './function/matrix/diff.js' +export { createOnes } from './function/matrix/ones.js' +export { createRange } from './function/matrix/range.js' +export { createReshape } from './function/matrix/reshape.js' +export { createResize } from './function/matrix/resize.js' +export { createRow } from './function/matrix/row.js' +export { createSize } from './function/matrix/size.js' +export { createSqueeze } from './function/matrix/squeeze.js' +export { createSubset } from './function/matrix/subset.js' +export { createTranspose } from './function/matrix/transpose.js' +export { createCtranspose } from './function/matrix/ctranspose.js' +export { createZeros } from './function/matrix/zeros.js' +export { createErf } from './function/special/erf.js' +export { createMode } from './function/statistics/mode.js' +export { createProd } from './function/statistics/prod.js' +export { createFormat } from './function/string/format.js' +export { createPrint } from './function/string/print.js' +export { createTo } from './function/unit/to.js' +export { createIsPrime } from './function/utils/isPrime.js' +export { createNumeric } from './function/utils/numeric.js' +export { createDivideScalar } from './function/arithmetic/divideScalar.js' +export { createPow } from './function/arithmetic/pow.js' +export { createRound } from './function/arithmetic/round.js' +export { createLog } from './function/arithmetic/log.js' +export { createLog1p } from './function/arithmetic/log1p.js' +export { createNthRoots } from './function/arithmetic/nthRoots.js' +export { createDotPow } from './function/arithmetic/dotPow.js' +export { createDotDivide } from './function/arithmetic/dotDivide.js' +export { createLsolve } from './function/algebra/solver/lsolve.js' +export { createUsolve } from './function/algebra/solver/usolve.js' +export { createLeftShift } from './function/bitwise/leftShift.js' +export { createRightArithShift } from './function/bitwise/rightArithShift.js' +export { createRightLogShift } from './function/bitwise/rightLogShift.js' +export { createAnd } from './function/logical/and.js' +export { createCompare } from './function/relational/compare.js' +export { createCompareNatural } from './function/relational/compareNatural.js' +export { createCompareText } from './function/relational/compareText.js' +export { createEqual } from './function/relational/equal.js' +export { createEqualText } from './function/relational/equalText.js' +export { createSmaller } from './function/relational/smaller.js' +export { createSmallerEq } from './function/relational/smallerEq.js' +export { createLarger } from './function/relational/larger.js' +export { createLargerEq } from './function/relational/largerEq.js' +export { createDeepEqual } from './function/relational/deepEqual.js' +export { createUnequal } from './function/relational/unequal.js' +export { createPartitionSelect } from './function/matrix/partitionSelect.js' +export { createSort } from './function/matrix/sort.js' +export { createMax } from './function/statistics/max.js' +export { createMin } from './function/statistics/min.js' +export { createImmutableDenseMatrixClass } from './type/matrix/ImmutableDenseMatrix.js' +export { createIndexClass } from './type/matrix/MatrixIndex.js' +export { createFibonacciHeapClass } from './type/matrix/FibonacciHeap.js' +export { createSpaClass } from './type/matrix/Spa.js' +export { createUnitClass } from './type/unit/Unit.js' +export { createUnitFunction } from './type/unit/function/unit.js' +export { createSparse } from './type/matrix/function/sparse.js' +export { createCreateUnit } from './type/unit/function/createUnit.js' +export { createAcos } from './function/trigonometry/acos.js' +export { createAcosh } from './function/trigonometry/acosh.js' +export { createAcot } from './function/trigonometry/acot.js' +export { createAcoth } from './function/trigonometry/acoth.js' +export { createAcsc } from './function/trigonometry/acsc.js' +export { createAcsch } from './function/trigonometry/acsch.js' +export { createAsec } from './function/trigonometry/asec.js' +export { createAsech } from './function/trigonometry/asech.js' +export { createAsin } from './function/trigonometry/asin.js' +export { createAsinh } from './function/trigonometry/asinh.js' +export { createAtan } from './function/trigonometry/atan.js' +export { createAtan2 } from './function/trigonometry/atan2.js' +export { createAtanh } from './function/trigonometry/atanh.js' +export { createCos } from './function/trigonometry/cos.js' +export { createCosh } from './function/trigonometry/cosh.js' +export { createCot } from './function/trigonometry/cot.js' +export { createCoth } from './function/trigonometry/coth.js' +export { createCsc } from './function/trigonometry/csc.js' +export { createCsch } from './function/trigonometry/csch.js' +export { createSec } from './function/trigonometry/sec.js' +export { createSech } from './function/trigonometry/sech.js' +export { createSin } from './function/trigonometry/sin.js' +export { createSinh } from './function/trigonometry/sinh.js' +export { createTan } from './function/trigonometry/tan.js' +export { createTanh } from './function/trigonometry/tanh.js' +export { createSetCartesian } from './function/set/setCartesian.js' +export { createSetDifference } from './function/set/setDifference.js' +export { createSetDistinct } from './function/set/setDistinct.js' +export { createSetIntersect } from './function/set/setIntersect.js' +export { createSetIsSubset } from './function/set/setIsSubset.js' +export { createSetMultiplicity } from './function/set/setMultiplicity.js' +export { createSetPowerset } from './function/set/setPowerset.js' +export { createSetSize } from './function/set/setSize.js' +export { createSetSymDifference } from './function/set/setSymDifference.js' +export { createSetUnion } from './function/set/setUnion.js' +export { createAdd } from './function/arithmetic/add.js' +export { createHypot } from './function/arithmetic/hypot.js' +export { createNorm } from './function/arithmetic/norm.js' +export { createDot } from './function/matrix/dot.js' +export { createTrace } from './function/matrix/trace.js' +export { createIndex } from './type/matrix/function/index.js' +export { createNode } from './expression/node/Node.js' +export { createAccessorNode } from './expression/node/AccessorNode.js' +export { createArrayNode } from './expression/node/ArrayNode.js' +export { createAssignmentNode } from './expression/node/AssignmentNode.js' +export { createBlockNode } from './expression/node/BlockNode.js' +export { createConditionalNode } from './expression/node/ConditionalNode.js' +export { createConstantNode } from './expression/node/ConstantNode.js' +export { createFunctionAssignmentNode } from './expression/node/FunctionAssignmentNode.js' +export { createIndexNode } from './expression/node/IndexNode.js' +export { createObjectNode } from './expression/node/ObjectNode.js' +export { createOperatorNode } from './expression/node/OperatorNode.js' +export { createParenthesisNode } from './expression/node/ParenthesisNode.js' +export { createRangeNode } from './expression/node/RangeNode.js' +export { createRelationalNode } from './expression/node/RelationalNode.js' +export { createSymbolNode } from './expression/node/SymbolNode.js' +export { createFunctionNode } from './expression/node/FunctionNode.js' +export { createParse } from './expression/parse.js' +export { createCompile } from './expression/function/compile.js' +export { createEvaluate } from './expression/function/evaluate.js' +export { createParserClass } from './expression/Parser.js' +export { createParser } from './expression/function/parser.js' +export { createLup } from './function/algebra/decomposition/lup.js' +export { createQr } from './function/algebra/decomposition/qr.js' +export { createSlu } from './function/algebra/decomposition/slu.js' +export { createLusolve } from './function/algebra/solver/lusolve.js' +export { createHelpClass } from './expression/Help.js' +export { createChainClass } from './type/chain/Chain.js' +export { createHelp } from './expression/function/help.js' +export { createChain } from './type/chain/function/chain.js' +export { createDet } from './function/matrix/det.js' +export { createInv } from './function/matrix/inv.js' +export { createEigs } from './function/matrix/eigs.js' +export { createExpm } from './function/matrix/expm.js' +export { createSqrtm } from './function/matrix/sqrtm.js' +export { createDivide } from './function/arithmetic/divide.js' +export { createDistance } from './function/geometry/distance.js' +export { createIntersect } from './function/geometry/intersect.js' +export { createSum } from './function/statistics/sum.js' +export { createMean } from './function/statistics/mean.js' +export { createMedian } from './function/statistics/median.js' +export { createMad } from './function/statistics/mad.js' +export { createVariance } from './function/statistics/variance.js' +export { createQuantileSeq } from './function/statistics/quantileSeq.js' +export { createStd } from './function/statistics/std.js' +export { createCombinations } from './function/probability/combinations.js' +export { createCombinationsWithRep } from './function/probability/combinationsWithRep.js' +export { createGamma } from './function/probability/gamma.js' +export { createFactorial } from './function/probability/factorial.js' +export { createKldivergence } from './function/probability/kldivergence.js' +export { createMultinomial } from './function/probability/multinomial.js' +export { createPermutations } from './function/probability/permutations.js' +export { createPickRandom } from './function/probability/pickRandom.js' +export { createRandom } from './function/probability/random.js' +export { createRandomInt } from './function/probability/randomInt.js' +export { createStirlingS2 } from './function/combinatorics/stirlingS2.js' +export { createBellNumbers } from './function/combinatorics/bellNumbers.js' +export { createCatalan } from './function/combinatorics/catalan.js' +export { createComposition } from './function/combinatorics/composition.js' +export { createSimplify } from './function/algebra/simplify.js' +export { createDerivative } from './function/algebra/derivative.js' +export { createRationalize } from './function/algebra/rationalize.js' +export { createReviver } from './json/reviver.js' +export { createReplacer } from './json/replacer.js' export { createE, createUppercaseE, @@ -254,7 +254,7 @@ export { createTau, createTrue, createVersion -} from './constants' +} from './constants.js' export { createAtomicMass, createAvogadro, @@ -306,20 +306,21 @@ export { createVacuumImpedance, createWeakMixingAngle, createWienDisplacement -} from './type/unit/physicalConstants' -export { createApplyTransform } from './expression/transform/apply.transform' -export { createColumnTransform } from './expression/transform/column.transform' -export { createFilterTransform } from './expression/transform/filter.transform' -export { createForEachTransform } from './expression/transform/forEach.transform' -export { createIndexTransform } from './expression/transform/index.transform' -export { createMapTransform } from './expression/transform/map.transform' -export { createMaxTransform } from './expression/transform/max.transform' -export { createMeanTransform } from './expression/transform/mean.transform' -export { createMinTransform } from './expression/transform/min.transform' -export { createRangeTransform } from './expression/transform/range.transform' -export { createRowTransform } from './expression/transform/row.transform' -export { createSubsetTransform } from './expression/transform/subset.transform' -export { createConcatTransform } from './expression/transform/concat.transform' -export { createStdTransform } from './expression/transform/std.transform' -export { createSumTransform } from './expression/transform/sum.transform' -export { createVarianceTransform } from './expression/transform/variance.transform' +} from './type/unit/physicalConstants.js' +export { createApplyTransform } from './expression/transform/apply.transform.js' +export { createColumnTransform } from './expression/transform/column.transform.js' +export { createFilterTransform } from './expression/transform/filter.transform.js' +export { createForEachTransform } from './expression/transform/forEach.transform.js' +export { createIndexTransform } from './expression/transform/index.transform.js' +export { createMapTransform } from './expression/transform/map.transform.js' +export { createMaxTransform } from './expression/transform/max.transform.js' +export { createMeanTransform } from './expression/transform/mean.transform.js' +export { createMinTransform } from './expression/transform/min.transform.js' +export { createRangeTransform } from './expression/transform/range.transform.js' +export { createRowTransform } from './expression/transform/row.transform.js' +export { createSubsetTransform } from './expression/transform/subset.transform.js' +export { createConcatTransform } from './expression/transform/concat.transform.js' +export { createDiffTransform } from './expression/transform/diff.transform.js' +export { createStdTransform } from './expression/transform/std.transform.js' +export { createSumTransform } from './expression/transform/sum.transform.js' +export { createVarianceTransform } from './expression/transform/variance.transform.js' diff --git a/src/factoriesNumber.js b/src/factoriesNumber.js index 6bda89954b..3350e4b7fc 100644 --- a/src/factoriesNumber.js +++ b/src/factoriesNumber.js @@ -69,29 +69,29 @@ import { unaryPlusNumber, xgcdNumber, xorNumber -} from './plain/number' +} from './plain/number/index.js' -import { factory } from './utils/factory' -import { noIndex, noMatrix, noSubset } from './utils/noop' +import { factory } from './utils/factory.js' +import { noIndex, noMatrix, noSubset } from './utils/noop.js' // ---------------------------------------------------------------------------- // classes and functions // core -export { createTyped } from './core/function/typed' +export { createTyped } from './core/function/typed.js' // classes -export { createResultSet } from './type/resultset/ResultSet' -export { createRangeClass } from './type/matrix/Range' -export { createHelpClass } from './expression/Help' -export { createChainClass } from './type/chain/Chain' -export { createHelp } from './expression/function/help' -export { createChain } from './type/chain/function/chain' +export { createResultSet } from './type/resultset/ResultSet.js' +export { createRangeClass } from './type/matrix/Range.js' +export { createHelpClass } from './expression/Help.js' +export { createChainClass } from './type/chain/Chain.js' +export { createHelp } from './expression/function/help.js' +export { createChain } from './type/chain/function/chain.js' // algebra -export { createSimplify } from './function/algebra/simplify' -export { createDerivative } from './function/algebra/derivative' -export { createRationalize } from './function/algebra/rationalize' +export { createSimplify } from './function/algebra/simplify.js' +export { createDerivative } from './function/algebra/derivative.js' +export { createRationalize } from './function/algebra/rationalize.js' // arithmetic export const createUnaryMinus = /* #__PURE__ */ createNumberFactory('unaryMinus', unaryMinusNumber) @@ -112,7 +112,7 @@ export const createLog2 = /* #__PURE__ */ createNumberFactory('log2', log2Number export const createMod = /* #__PURE__ */ createNumberFactory('mod', modNumber) export const createMultiplyScalar = /* #__PURE__ */ createNumberFactory('multiplyScalar', multiplyNumber) export const createMultiply = /* #__PURE__ */ createNumberFactory('multiply', multiplyNumber) -export { createNthRootNumber as createNthRoot } from './function/arithmetic/nthRoot' +export { createNthRootNumber as createNthRoot } from './function/arithmetic/nthRoot.js' export const createSign = /* #__PURE__ */ createNumberFactory('sign', signNumber) export const createSqrt = /* #__PURE__ */ createNumberFactory('sqrt', sqrtNumber) export const createSquare = /* #__PURE__ */ createNumberFactory('square', squareNumber) @@ -120,11 +120,11 @@ export const createSubtract = /* #__PURE__ */ createNumberFactory('subtract', su export const createXgcd = /* #__PURE__ */ createNumberFactory('xgcd', xgcdNumber) export const createDivideScalar = /* #__PURE__ */ createNumberFactory('divideScalar', divideNumber) export const createPow = /* #__PURE__ */ createNumberFactory('pow', powNumber) -export { createRoundNumber as createRound } from './function/arithmetic/round' +export { createRoundNumber as createRound } from './function/arithmetic/round.js' export const createLog = /* #__PURE__ */ createNumberFactory('log', logNumber) export const createLog1p = /* #__PURE__ */ createNumberFactory('log1p', log1pNumber) export const createAdd = /* #__PURE__ */ createNumberFactory('add', addNumber) -export { createHypot } from './function/arithmetic/hypot' +export { createHypot } from './function/arithmetic/hypot.js' export const createNorm = /* #__PURE__ */ createNumberFactory('norm', normNumber) export const createDivide = /* #__PURE__ */ createNumberFactory('divide', divideNumber) @@ -138,10 +138,10 @@ export const createRightArithShift = /* #__PURE__ */ createNumberFactory('rightA export const createRightLogShift = /* #__PURE__ */ createNumberFactory('rightLogShift', rightLogShiftNumber) // combinatorics -export { createStirlingS2 } from './function/combinatorics/stirlingS2' -export { createBellNumbers } from './function/combinatorics/bellNumbers' -export { createCatalan } from './function/combinatorics/catalan' -export { createComposition } from './function/combinatorics/composition' +export { createStirlingS2 } from './function/combinatorics/stirlingS2.js' +export { createBellNumbers } from './function/combinatorics/bellNumbers.js' +export { createCatalan } from './function/combinatorics/catalan.js' +export { createComposition } from './function/combinatorics/composition.js' // constants export { @@ -164,35 +164,35 @@ export { createTau, createTrue, createVersion -} from './constants' +} from './constants.js' // create -export { createNumber } from './type/number' -export { createString } from './type/string' -export { createBoolean } from './type/boolean' -export { createParser } from './expression/function/parser' +export { createNumber } from './type/number.js' +export { createString } from './type/string.js' +export { createBoolean } from './type/boolean.js' +export { createParser } from './expression/function/parser.js' // expression -export { createNode } from './expression/node/Node' -export { createAccessorNode } from './expression/node/AccessorNode' -export { createArrayNode } from './expression/node/ArrayNode' -export { createAssignmentNode } from './expression/node/AssignmentNode' -export { createBlockNode } from './expression/node/BlockNode' -export { createConditionalNode } from './expression/node/ConditionalNode' -export { createConstantNode } from './expression/node/ConstantNode' -export { createFunctionAssignmentNode } from './expression/node/FunctionAssignmentNode' -export { createIndexNode } from './expression/node/IndexNode' -export { createObjectNode } from './expression/node/ObjectNode' -export { createOperatorNode } from './expression/node/OperatorNode' -export { createParenthesisNode } from './expression/node/ParenthesisNode' -export { createRangeNode } from './expression/node/RangeNode' -export { createRelationalNode } from './expression/node/RelationalNode' -export { createSymbolNode } from './expression/node/SymbolNode' -export { createFunctionNode } from './expression/node/FunctionNode' -export { createParse } from './expression/parse' -export { createCompile } from './expression/function/compile' -export { createEvaluate } from './expression/function/evaluate' -export { createParserClass } from './expression/Parser' +export { createNode } from './expression/node/Node.js' +export { createAccessorNode } from './expression/node/AccessorNode.js' +export { createArrayNode } from './expression/node/ArrayNode.js' +export { createAssignmentNode } from './expression/node/AssignmentNode.js' +export { createBlockNode } from './expression/node/BlockNode.js' +export { createConditionalNode } from './expression/node/ConditionalNode.js' +export { createConstantNode } from './expression/node/ConstantNode.js' +export { createFunctionAssignmentNode } from './expression/node/FunctionAssignmentNode.js' +export { createIndexNode } from './expression/node/IndexNode.js' +export { createObjectNode } from './expression/node/ObjectNode.js' +export { createOperatorNode } from './expression/node/OperatorNode.js' +export { createParenthesisNode } from './expression/node/ParenthesisNode.js' +export { createRangeNode } from './expression/node/RangeNode.js' +export { createRelationalNode } from './expression/node/RelationalNode.js' +export { createSymbolNode } from './expression/node/SymbolNode.js' +export { createFunctionNode } from './expression/node/FunctionNode.js' +export { createParse } from './expression/parse.js' +export { createCompile } from './expression/function/compile.js' +export { createEvaluate } from './expression/function/evaluate.js' +export { createParserClass } from './expression/Parser.js' // logical export const createAnd = /* #__PURE__ */ createNumberFactory('and', andNumber) @@ -201,64 +201,64 @@ export const createOr = /* #__PURE__ */ createNumberFactory('or', orNumber) export const createXor = /* #__PURE__ */ createNumberFactory('xor', xorNumber) // matrix -export { createApply } from './function/matrix/apply' -export { createFilter } from './function/matrix/filter' -export { createForEach } from './function/matrix/forEach' -export { createMap } from './function/matrix/map' -export { createRange } from './function/matrix/range' -export { createSize } from './function/matrix/size' +export { createApply } from './function/matrix/apply.js' +export { createFilter } from './function/matrix/filter.js' +export { createForEach } from './function/matrix/forEach.js' +export { createMap } from './function/matrix/map.js' +export { createRange } from './function/matrix/range.js' +export { createSize } from './function/matrix/size.js' // FIXME: create a lightweight "number" implementation of subset only supporting plain objects/arrays export const createIndex = /* #__PURE__ */ factory('index', [], () => noIndex) export const createMatrix = /* #__PURE__ */ factory('matrix', [], () => noMatrix) // FIXME: needed now because subset transform needs it. Remove the need for it in subset export const createSubset = /* #__PURE__ */ factory('subset', [], () => noSubset) // TODO: provide number+array implementations for map, filter, forEach, zeros, ...? // TODO: create range implementation for range? -export { createPartitionSelect } from './function/matrix/partitionSelect' +export { createPartitionSelect } from './function/matrix/partitionSelect.js' // probability export const createCombinations = createNumberFactory('combinations', combinationsNumber) export const createGamma = createNumberFactory('gamma', gammaNumber) -export { createCombinationsWithRep } from './function/probability/combinationsWithRep' -export { createFactorial } from './function/probability/factorial' -export { createMultinomial } from './function/probability/multinomial' -export { createPermutations } from './function/probability/permutations' -export { createPickRandom } from './function/probability/pickRandom' -export { createRandomNumber as createRandom } from './function/probability/random' -export { createRandomInt } from './function/probability/randomInt' +export { createCombinationsWithRep } from './function/probability/combinationsWithRep.js' +export { createFactorial } from './function/probability/factorial.js' +export { createMultinomial } from './function/probability/multinomial.js' +export { createPermutations } from './function/probability/permutations.js' +export { createPickRandom } from './function/probability/pickRandom.js' +export { createRandomNumber as createRandom } from './function/probability/random.js' +export { createRandomInt } from './function/probability/randomInt.js' // relational -export { createEqualScalarNumber as createEqualScalar } from './function/relational/equalScalar' -export { createCompareNumber as createCompare } from './function/relational/compare' -export { createCompareNatural } from './function/relational/compareNatural' -export { createCompareTextNumber as createCompareText } from './function/relational/compareText' -export { createEqualNumber as createEqual } from './function/relational/equal' -export { createEqualText } from './function/relational/equalText' -export { createSmallerNumber as createSmaller } from './function/relational/smaller' -export { createSmallerEqNumber as createSmallerEq } from './function/relational/smallerEq' -export { createLargerNumber as createLarger } from './function/relational/larger' -export { createLargerEqNumber as createLargerEq } from './function/relational/largerEq' -export { createDeepEqual } from './function/relational/deepEqual' -export { createUnequalNumber as createUnequal } from './function/relational/unequal' +export { createEqualScalarNumber as createEqualScalar } from './function/relational/equalScalar.js' +export { createCompareNumber as createCompare } from './function/relational/compare.js' +export { createCompareNatural } from './function/relational/compareNatural.js' +export { createCompareTextNumber as createCompareText } from './function/relational/compareText.js' +export { createEqualNumber as createEqual } from './function/relational/equal.js' +export { createEqualText } from './function/relational/equalText.js' +export { createSmallerNumber as createSmaller } from './function/relational/smaller.js' +export { createSmallerEqNumber as createSmallerEq } from './function/relational/smallerEq.js' +export { createLargerNumber as createLarger } from './function/relational/larger.js' +export { createLargerEqNumber as createLargerEq } from './function/relational/largerEq.js' +export { createDeepEqual } from './function/relational/deepEqual.js' +export { createUnequalNumber as createUnequal } from './function/relational/unequal.js' // special -export { createErf } from './function/special/erf' +export { createErf } from './function/special/erf.js' // statistics -export { createMode } from './function/statistics/mode' -export { createProd } from './function/statistics/prod' -export { createMax } from './function/statistics/max' -export { createMin } from './function/statistics/min' -export { createSum } from './function/statistics/sum' -export { createMean } from './function/statistics/mean' -export { createMedian } from './function/statistics/median' -export { createMad } from './function/statistics/mad' -export { createVariance } from './function/statistics/variance' -export { createQuantileSeq } from './function/statistics/quantileSeq' -export { createStd } from './function/statistics/std' +export { createMode } from './function/statistics/mode.js' +export { createProd } from './function/statistics/prod.js' +export { createMax } from './function/statistics/max.js' +export { createMin } from './function/statistics/min.js' +export { createSum } from './function/statistics/sum.js' +export { createMean } from './function/statistics/mean.js' +export { createMedian } from './function/statistics/median.js' +export { createMad } from './function/statistics/mad.js' +export { createVariance } from './function/statistics/variance.js' +export { createQuantileSeq } from './function/statistics/quantileSeq.js' +export { createStd } from './function/statistics/std.js' // string -export { createFormat } from './function/string/format' -export { createPrint } from './function/string/print' +export { createFormat } from './function/string/format.js' +export { createPrint } from './function/string/print.js' // trigonometry export const createAcos = /* #__PURE__ */ createNumberFactory('acos', acosNumber) @@ -288,34 +288,35 @@ export const createTan = /* #__PURE__ */ createNumberFactory('tan', tanNumber) export const createTanh = /* #__PURE__ */ createNumberFactory('tanh', tanhNumber) // transforms -export { createApplyTransform } from './expression/transform/apply.transform' -export { createFilterTransform } from './expression/transform/filter.transform' -export { createForEachTransform } from './expression/transform/forEach.transform' -export { createMapTransform } from './expression/transform/map.transform' -export { createMaxTransform } from './expression/transform/max.transform' -export { createMeanTransform } from './expression/transform/mean.transform' -export { createMinTransform } from './expression/transform/min.transform' -export { createRangeTransform } from './expression/transform/range.transform' -export { createSubsetTransform } from './expression/transform/subset.transform' -export { createStdTransform } from './expression/transform/std.transform' -export { createSumTransform } from './expression/transform/sum.transform' -export { createVarianceTransform } from './expression/transform/variance.transform' +export { createApplyTransform } from './expression/transform/apply.transform.js' +export { createFilterTransform } from './expression/transform/filter.transform.js' +export { createForEachTransform } from './expression/transform/forEach.transform.js' +export { createMapTransform } from './expression/transform/map.transform.js' +export { createMaxTransform } from './expression/transform/max.transform.js' +export { createMeanTransform } from './expression/transform/mean.transform.js' +export { createMinTransform } from './expression/transform/min.transform.js' +export { createRangeTransform } from './expression/transform/range.transform.js' +export { createSubsetTransform } from './expression/transform/subset.transform.js' +export { createStdTransform } from './expression/transform/std.transform.js' +export { createSumTransform } from './expression/transform/sum.transform.js' +export { createVarianceTransform } from './expression/transform/variance.transform.js' // utils -export { createClone } from './function/utils/clone' +export { createClone } from './function/utils/clone.js' export const createIsInteger = /* #__PURE__ */ createNumberFactory('isInteger', isIntegerNumber) export const createIsNegative = /* #__PURE__ */ createNumberFactory('isNegative', isNegativeNumber) -export { createIsNumeric } from './function/utils/isNumeric' -export { createHasNumericValue } from './function/utils/hasNumericValue' +export { createIsNumeric } from './function/utils/isNumeric.js' +export { createHasNumericValue } from './function/utils/hasNumericValue.js' export const createIsPositive = /* #__PURE__ */ createNumberFactory('isPositive', isPositiveNumber) export const createIsZero = /* #__PURE__ */ createNumberFactory('isZero', isZeroNumber) export const createIsNaN = /* #__PURE__ */ createNumberFactory('isNaN', isNaNNumber) -export { createTypeOf } from './function/utils/typeOf' -export { createIsPrime } from './function/utils/isPrime' -export { createNumeric } from './function/utils/numeric' +export { createTypeOf } from './function/utils/typeOf.js' +export { createIsPrime } from './function/utils/isPrime.js' +export { createNumeric } from './function/utils/numeric.js' // json -export { createReviver } from './json/reviver' +export { createReviver } from './json/reviver.js' +export { createReplacer } from './json/replacer.js' // helper function to create a factory function for a function which only needs typed-function function createNumberFactory (name, fn) { diff --git a/src/function/algebra/decomposition/lup.js b/src/function/algebra/decomposition/lup.js index abfc5f9410..d841aaffd5 100644 --- a/src/function/algebra/decomposition/lup.js +++ b/src/function/algebra/decomposition/lup.js @@ -1,5 +1,5 @@ -import { clone } from '../../../utils/object' -import { factory } from '../../../utils/factory' +import { clone } from '../../../utils/object.js' +import { factory } from '../../../utils/factory.js' const name = 'lup' const dependencies = [ diff --git a/src/function/algebra/decomposition/qr.js b/src/function/algebra/decomposition/qr.js index 883917bbd8..03bf7b17a9 100644 --- a/src/function/algebra/decomposition/qr.js +++ b/src/function/algebra/decomposition/qr.js @@ -1,4 +1,4 @@ -import { factory } from '../../../utils/factory' +import { factory } from '../../../utils/factory.js' const name = 'qr' const dependencies = [ diff --git a/src/function/algebra/decomposition/slu.js b/src/function/algebra/decomposition/slu.js index 1f1c0fbe14..991bd1a4ab 100644 --- a/src/function/algebra/decomposition/slu.js +++ b/src/function/algebra/decomposition/slu.js @@ -1,7 +1,7 @@ -import { isInteger } from '../../../utils/number' -import { factory } from '../../../utils/factory' -import { createCsSqr } from '../sparse/csSqr' -import { createCsLu } from '../sparse/csLu' +import { isInteger } from '../../../utils/number.js' +import { factory } from '../../../utils/factory.js' +import { createCsSqr } from '../sparse/csSqr.js' +import { createCsLu } from '../sparse/csLu.js' const name = 'slu' const dependencies = [ diff --git a/src/function/algebra/derivative.js b/src/function/algebra/derivative.js index 6ddedef694..745d810caf 100644 --- a/src/function/algebra/derivative.js +++ b/src/function/algebra/derivative.js @@ -1,5 +1,5 @@ -import { isConstantNode, typeOf } from '../../utils/is' -import { factory } from '../../utils/factory' +import { isConstantNode, typeOf } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' const name = 'derivative' const dependencies = [ @@ -77,28 +77,28 @@ export const createDerivative = /* #__PURE__ */ factory(name, dependencies, ({ return options.simplify ? simplify(res) : res }, 'Node, SymbolNode': function (expr, variable) { - return derivative(expr, variable, { simplify: true }) + return this(expr, variable, { simplify: true }) }, 'string, SymbolNode': function (expr, variable) { - return derivative(parse(expr), variable) + return this(parse(expr), variable) }, 'string, SymbolNode, Object': function (expr, variable, options) { - return derivative(parse(expr), variable, options) + return this(parse(expr), variable, options) }, 'string, string': function (expr, variable) { - return derivative(parse(expr), parse(variable)) + return this(parse(expr), parse(variable)) }, 'string, string, Object': function (expr, variable, options) { - return derivative(parse(expr), parse(variable), options) + return this(parse(expr), parse(variable), options) }, 'Node, string': function (expr, variable) { - return derivative(expr, parse(variable)) + return this(expr, parse(variable)) }, 'Node, string, Object': function (expr, variable, options) { - return derivative(expr, parse(variable), options) + return this(expr, parse(variable), options) } // TODO: replace the 8 signatures above with 4 as soon as typed-function supports optional arguments diff --git a/src/function/algebra/index.js b/src/function/algebra/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/algebra/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/algebra/rationalize.js b/src/function/algebra/rationalize.js index 5f01babb7e..59e27d25a2 100644 --- a/src/function/algebra/rationalize.js +++ b/src/function/algebra/rationalize.js @@ -1,7 +1,7 @@ -import { isInteger } from '../../utils/number' -import { factory } from '../../utils/factory' -import { createSimplifyConstant } from './simplify/simplifyConstant' -import { createSimplifyCore } from './simplify/simplifyCore' +import { isInteger } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' +import { createSimplifyConstant } from './simplify/simplifyConstant.js' +import { createSimplifyCore } from './simplify/simplifyCore.js' const name = 'rationalize' const dependencies = [ @@ -125,33 +125,33 @@ export const createRationalize = /* #__PURE__ */ factory(name, dependencies, ({ * {Expression Node} node simplified expression * */ - const rationalize = typed(name, { + return typed(name, { string: function (expr) { - return rationalize(parse(expr), {}, false) + return this(parse(expr), {}, false) }, 'string, boolean': function (expr, detailed) { - return rationalize(parse(expr), {}, detailed) + return this(parse(expr), {}, detailed) }, 'string, Object': function (expr, scope) { - return rationalize(parse(expr), scope, false) + return this(parse(expr), scope, false) }, 'string, Object, boolean': function (expr, scope, detailed) { - return rationalize(parse(expr), scope, detailed) + return this(parse(expr), scope, detailed) }, Node: function (expr) { - return rationalize(expr, {}, false) + return this(expr, {}, false) }, 'Node, boolean': function (expr, detailed) { - return rationalize(expr, {}, detailed) + return this(expr, {}, detailed) }, 'Node, Object': function (expr, scope) { - return rationalize(expr, scope, false) + return this(expr, scope, false) }, 'Node, Object, boolean': function (expr, scope, detailed) { @@ -643,6 +643,4 @@ export const createRationalize = /* #__PURE__ */ factory(name, dependencies, ({ } else { throw new Error('Type ' + tp + ' is not allowed') } } // End of recurPol } // End of polyToCanonical - - return rationalize }) diff --git a/src/function/algebra/simplify.js b/src/function/algebra/simplify.js index ace2e96145..1a18cb9509 100644 --- a/src/function/algebra/simplify.js +++ b/src/function/algebra/simplify.js @@ -1,10 +1,10 @@ -import { isConstantNode, isParenthesisNode } from '../../utils/is' -import { factory } from '../../utils/factory' -import { createUtil } from './simplify/util' -import { createSimplifyCore } from './simplify/simplifyCore' -import { createSimplifyConstant } from './simplify/simplifyConstant' -import { createResolve } from './simplify/resolve' -import { hasOwnProperty } from '../../utils/object' +import { isConstantNode, isParenthesisNode } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' +import { createUtil } from './simplify/util.js' +import { createSimplifyCore } from './simplify/simplifyCore.js' +import { createSimplifyConstant } from './simplify/simplifyConstant.js' +import { createResolve } from './simplify/resolve.js' +import { hasOwnProperty } from '../../utils/object.js' const name = 'simplify' const dependencies = [ @@ -154,47 +154,47 @@ export const createSimplify = /* #__PURE__ */ factory(name, dependencies, ( */ const simplify = typed('simplify', { string: function (expr) { - return simplify(parse(expr), simplify.rules, {}, {}) + return this(parse(expr), this.rules, {}, {}) }, 'string, Object': function (expr, scope) { - return simplify(parse(expr), simplify.rules, scope, {}) + return this(parse(expr), this.rules, scope, {}) }, 'string, Object, Object': function (expr, scope, options) { - return simplify(parse(expr), simplify.rules, scope, options) + return this(parse(expr), this.rules, scope, options) }, 'string, Array': function (expr, rules) { - return simplify(parse(expr), rules, {}, {}) + return this(parse(expr), rules, {}, {}) }, 'string, Array, Object': function (expr, rules, scope) { - return simplify(parse(expr), rules, scope, {}) + return this(parse(expr), rules, scope, {}) }, 'string, Array, Object, Object': function (expr, rules, scope, options) { - return simplify(parse(expr), rules, scope, options) + return this(parse(expr), rules, scope, options) }, 'Node, Object': function (expr, scope) { - return simplify(expr, simplify.rules, scope, {}) + return this(expr, this.rules, scope, {}) }, 'Node, Object, Object': function (expr, scope, options) { - return simplify(expr, simplify.rules, scope, options) + return this(expr, this.rules, scope, options) }, Node: function (expr) { - return simplify(expr, simplify.rules, {}, {}) + return this(expr, this.rules, {}, {}) }, 'Node, Array': function (expr, rules) { - return simplify(expr, rules, {}, {}) + return this(expr, rules, {}, {}) }, 'Node, Array, Object': function (expr, rules, scope) { - return simplify(expr, rules, scope, {}) + return this(expr, rules, scope, {}) }, 'Node, Array, Object, Object': function (expr, rules, scope, options) { @@ -510,16 +510,21 @@ export const createSimplify = /* #__PURE__ */ factory(name, dependencies, ( // Placeholders with the same key must match exactly for (const key in match1.placeholders) { - res.placeholders[key] = match1.placeholders[key] - if (hasOwnProperty(match2.placeholders, key)) { - if (!_exactMatch(match1.placeholders[key], match2.placeholders[key])) { - return null + if (hasOwnProperty(match1.placeholders, key)) { + res.placeholders[key] = match1.placeholders[key] + + if (hasOwnProperty(match2.placeholders, key)) { + if (!_exactMatch(match1.placeholders[key], match2.placeholders[key])) { + return null + } } } } for (const key in match2.placeholders) { - res.placeholders[key] = match2.placeholders[key] + if (hasOwnProperty(match2.placeholders, key)) { + res.placeholders[key] = match2.placeholders[key] + } } return res diff --git a/src/function/algebra/simplify/resolve.js b/src/function/algebra/simplify/resolve.js index ddaf5e7df0..7d7d638664 100644 --- a/src/function/algebra/simplify/resolve.js +++ b/src/function/algebra/simplify/resolve.js @@ -1,5 +1,5 @@ -import { isFunctionNode, isNode, isOperatorNode, isParenthesisNode, isSymbolNode } from '../../../utils/is' -import { factory } from '../../../utils/factory' +import { isFunctionNode, isNode, isOperatorNode, isParenthesisNode, isSymbolNode } from '../../../utils/is.js' +import { factory } from '../../../utils/factory.js' const name = 'resolve' const dependencies = [ diff --git a/src/function/algebra/simplify/simplifyConstant.js b/src/function/algebra/simplify/simplifyConstant.js index cb6b84b554..5747064b9b 100644 --- a/src/function/algebra/simplify/simplifyConstant.js +++ b/src/function/algebra/simplify/simplifyConstant.js @@ -1,8 +1,8 @@ // TODO this could be improved by simplifying seperated constants under associative and commutative operators -import { isFraction, isNode, isOperatorNode } from '../../../utils/is' -import { factory } from '../../../utils/factory' -import { createUtil } from './util' -import { noBignumber, noFraction } from '../../../utils/noop' +import { isFraction, isNode, isOperatorNode } from '../../../utils/is.js' +import { factory } from '../../../utils/factory.js' +import { createUtil } from './util.js' +import { noBignumber, noFraction } from '../../../utils/noop.js' const name = 'simplifyConstant' const dependencies = [ diff --git a/src/function/algebra/simplify/simplifyCore.js b/src/function/algebra/simplify/simplifyCore.js index e9e13c7e81..ad64cd551c 100644 --- a/src/function/algebra/simplify/simplifyCore.js +++ b/src/function/algebra/simplify/simplifyCore.js @@ -1,5 +1,5 @@ -import { isConstantNode, isFunctionNode, isOperatorNode, isParenthesisNode, isSymbolNode } from '../../../utils/is' -import { factory } from '../../../utils/factory' +import { isConstantNode, isFunctionNode, isOperatorNode, isParenthesisNode, isSymbolNode } from '../../../utils/is.js' +import { factory } from '../../../utils/factory.js' const name = 'simplifyCore' const dependencies = [ diff --git a/src/function/algebra/simplify/util.js b/src/function/algebra/simplify/util.js index 6a5a8ff4a0..0860bc9b80 100644 --- a/src/function/algebra/simplify/util.js +++ b/src/function/algebra/simplify/util.js @@ -1,6 +1,6 @@ -import { isOperatorNode } from '../../../utils/is' -import { factory } from '../../../utils/factory' -import { hasOwnProperty } from '../../../utils/object' +import { isOperatorNode } from '../../../utils/is.js' +import { factory } from '../../../utils/factory.js' +import { hasOwnProperty } from '../../../utils/object.js' const name = 'simplifyUtil' const dependencies = [ diff --git a/src/function/algebra/solver/lsolve.js b/src/function/algebra/solver/lsolve.js index d1e5b024dc..21c84fe140 100644 --- a/src/function/algebra/solver/lsolve.js +++ b/src/function/algebra/solver/lsolve.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { createSolveValidation } from './utils/solveValidation' +import { factory } from '../../../utils/factory.js' +import { createSolveValidation } from './utils/solveValidation.js' const name = 'lsolve' const dependencies = [ diff --git a/src/function/algebra/solver/lusolve.js b/src/function/algebra/solver/lusolve.js index fe64bf00ae..5e1dd37dc1 100644 --- a/src/function/algebra/solver/lusolve.js +++ b/src/function/algebra/solver/lusolve.js @@ -1,7 +1,7 @@ -import { isArray, isMatrix } from '../../../utils/is' -import { factory } from '../../../utils/factory' -import { createSolveValidation } from './utils/solveValidation' -import { csIpvec } from '../sparse/csIpvec' +import { isArray, isMatrix } from '../../../utils/is.js' +import { factory } from '../../../utils/factory.js' +import { createSolveValidation } from './utils/solveValidation.js' +import { csIpvec } from '../sparse/csIpvec.js' const name = 'lusolve' const dependencies = [ diff --git a/src/function/algebra/solver/usolve.js b/src/function/algebra/solver/usolve.js index 8767ba1753..4896f5e674 100644 --- a/src/function/algebra/solver/usolve.js +++ b/src/function/algebra/solver/usolve.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { createSolveValidation } from './utils/solveValidation' +import { factory } from '../../../utils/factory.js' +import { createSolveValidation } from './utils/solveValidation.js' const name = 'usolve' const dependencies = [ diff --git a/src/function/algebra/solver/utils/solveValidation.js b/src/function/algebra/solver/utils/solveValidation.js index 056a8f9db0..148b203b41 100644 --- a/src/function/algebra/solver/utils/solveValidation.js +++ b/src/function/algebra/solver/utils/solveValidation.js @@ -1,6 +1,6 @@ -import { isArray, isDenseMatrix, isMatrix } from '../../../../utils/is' -import { arraySize } from '../../../../utils/array' -import { format } from '../../../../utils/string' +import { isArray, isDenseMatrix, isMatrix } from '../../../../utils/is.js' +import { arraySize } from '../../../../utils/array.js' +import { format } from '../../../../utils/string.js' export function createSolveValidation ({ DenseMatrix }) { /** diff --git a/src/function/algebra/sparse/csAmd.js b/src/function/algebra/sparse/csAmd.js index ecdc721c09..3c105d54f4 100644 --- a/src/function/algebra/sparse/csAmd.js +++ b/src/function/algebra/sparse/csAmd.js @@ -1,7 +1,7 @@ -import { factory } from '../../../utils/factory' -import { csFkeep } from './csFkeep' -import { csFlip } from './csFlip' -import { csTdfs } from './csTdfs' +import { factory } from '../../../utils/factory.js' +import { csFkeep } from './csFkeep.js' +import { csFlip } from './csFlip.js' +import { csTdfs } from './csTdfs.js' const name = 'csAmd' const dependencies = [ diff --git a/src/function/algebra/sparse/csChol.js b/src/function/algebra/sparse/csChol.js index f8213d9eed..7f176c3d15 100644 --- a/src/function/algebra/sparse/csChol.js +++ b/src/function/algebra/sparse/csChol.js @@ -1,6 +1,6 @@ -import { factory } from '../../../utils/factory' -import { csEreach } from './csEreach' -import { createCsSymperm } from './csSymperm' +import { factory } from '../../../utils/factory.js' +import { csEreach } from './csEreach.js' +import { createCsSymperm } from './csSymperm.js' const name = 'csChol' const dependencies = [ diff --git a/src/function/algebra/sparse/csCounts.js b/src/function/algebra/sparse/csCounts.js index d00c106aa5..ded95c89c4 100644 --- a/src/function/algebra/sparse/csCounts.js +++ b/src/function/algebra/sparse/csCounts.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { csLeaf } from './csLeaf' +import { factory } from '../../../utils/factory.js' +import { csLeaf } from './csLeaf.js' const name = 'csCounts' const dependencies = [ diff --git a/src/function/algebra/sparse/csDfs.js b/src/function/algebra/sparse/csDfs.js index 462fde1695..6ffe0708c4 100644 --- a/src/function/algebra/sparse/csDfs.js +++ b/src/function/algebra/sparse/csDfs.js @@ -1,6 +1,6 @@ -import { csMarked } from './csMarked' -import { csMark } from './csMark' -import { csUnflip } from './csUnflip' +import { csMarked } from './csMarked.js' +import { csMark } from './csMark.js' +import { csUnflip } from './csUnflip.js' /** * Depth-first search computes the nonzero pattern xi of the directed graph G (Matrix) starting diff --git a/src/function/algebra/sparse/csEreach.js b/src/function/algebra/sparse/csEreach.js index 813e279d84..30ac8f041f 100644 --- a/src/function/algebra/sparse/csEreach.js +++ b/src/function/algebra/sparse/csEreach.js @@ -1,5 +1,5 @@ -import { csMark } from './csMark' -import { csMarked } from './csMarked' +import { csMark } from './csMark.js' +import { csMarked } from './csMarked.js' /** * Find nonzero pattern of Cholesky L(k,1:k-1) using etree and triu(A(:,k)) diff --git a/src/function/algebra/sparse/csLu.js b/src/function/algebra/sparse/csLu.js index 2035129b28..dcf2993996 100644 --- a/src/function/algebra/sparse/csLu.js +++ b/src/function/algebra/sparse/csLu.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { createCsSpsolve } from './csSpsolve' +import { factory } from '../../../utils/factory.js' +import { createCsSpsolve } from './csSpsolve.js' const name = 'csLu' const dependencies = [ diff --git a/src/function/algebra/sparse/csMark.js b/src/function/algebra/sparse/csMark.js index be2e82a4d5..04a023d410 100644 --- a/src/function/algebra/sparse/csMark.js +++ b/src/function/algebra/sparse/csMark.js @@ -1,4 +1,4 @@ -import { csFlip } from './csFlip' +import { csFlip } from './csFlip.js' /** * Marks the node at w[j] diff --git a/src/function/algebra/sparse/csPost.js b/src/function/algebra/sparse/csPost.js index b85ac2b459..146e124718 100644 --- a/src/function/algebra/sparse/csPost.js +++ b/src/function/algebra/sparse/csPost.js @@ -1,4 +1,4 @@ -import { csTdfs } from './csTdfs' +import { csTdfs } from './csTdfs.js' /** * Post order a tree of forest diff --git a/src/function/algebra/sparse/csReach.js b/src/function/algebra/sparse/csReach.js index f187ce5ab9..e78d97c8d2 100644 --- a/src/function/algebra/sparse/csReach.js +++ b/src/function/algebra/sparse/csReach.js @@ -1,6 +1,6 @@ -import { csMarked } from './csMarked' -import { csMark } from './csMark' -import { csDfs } from './csDfs' +import { csMarked } from './csMarked.js' +import { csMark } from './csMark.js' +import { csDfs } from './csDfs.js' /** * The csReach function computes X = Reach(B), where B is the nonzero pattern of the n-by-1 diff --git a/src/function/algebra/sparse/csSpsolve.js b/src/function/algebra/sparse/csSpsolve.js index 5821ae4dfe..0872e2a46c 100644 --- a/src/function/algebra/sparse/csSpsolve.js +++ b/src/function/algebra/sparse/csSpsolve.js @@ -1,5 +1,5 @@ -import { csReach } from './csReach' -import { factory } from '../../../utils/factory' +import { csReach } from './csReach.js' +import { factory } from '../../../utils/factory.js' const name = 'csSpsolve' const dependencies = [ diff --git a/src/function/algebra/sparse/csSqr.js b/src/function/algebra/sparse/csSqr.js index 37c1a46774..c15e14918f 100644 --- a/src/function/algebra/sparse/csSqr.js +++ b/src/function/algebra/sparse/csSqr.js @@ -1,9 +1,9 @@ -import { csPermute } from './csPermute' -import { csPost } from './csPost' -import { csEtree } from './csEtree' -import { createCsAmd } from './csAmd' -import { createCsCounts } from './csCounts' -import { factory } from '../../../utils/factory' +import { csPermute } from './csPermute.js' +import { csPost } from './csPost.js' +import { csEtree } from './csEtree.js' +import { createCsAmd } from './csAmd.js' +import { createCsCounts } from './csCounts.js' +import { factory } from '../../../utils/factory.js' const name = 'csSqr' const dependencies = [ diff --git a/src/function/algebra/sparse/csSymperm.js b/src/function/algebra/sparse/csSymperm.js index 3f6254b862..4c93fbf7a0 100644 --- a/src/function/algebra/sparse/csSymperm.js +++ b/src/function/algebra/sparse/csSymperm.js @@ -1,5 +1,5 @@ -import { csCumsum } from './csCumsum' -import { factory } from '../../../utils/factory' +import { csCumsum } from './csCumsum.js' +import { factory } from '../../../utils/factory.js' const name = 'csSymperm' const dependencies = ['conj', 'SparseMatrix'] diff --git a/src/function/algebra/sparse/csUnflip.js b/src/function/algebra/sparse/csUnflip.js index d2ce710ab4..59aa4e60c4 100644 --- a/src/function/algebra/sparse/csUnflip.js +++ b/src/function/algebra/sparse/csUnflip.js @@ -1,4 +1,4 @@ -import { csFlip } from './csFlip' +import { csFlip } from './csFlip.js' /** * Flips the value if it is negative of returns the same value otherwise. diff --git a/src/function/arithmetic/abs.js b/src/function/arithmetic/abs.js index 030795d559..e1c237e2e9 100644 --- a/src/function/arithmetic/abs.js +++ b/src/function/arithmetic/abs.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { absNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { absNumber } from '../../plain/number/index.js' const name = 'abs' const dependencies = ['typed'] @@ -30,7 +30,7 @@ export const createAbs = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @return {number | BigNumber | Fraction | Complex | Array | Matrix | Unit} * Absolute value of `x` */ - const abs = typed(name, { + return typed(name, { number: absNumber, Complex: function (x) { @@ -47,13 +47,11 @@ export const createAbs = /* #__PURE__ */ factory(name, dependencies, ({ typed }) 'Array | Matrix': function (x) { // deep map collection, skip zeros since abs(0) = 0 - return deepMap(x, abs, true) + return deepMap(x, this, true) }, Unit: function (x) { return x.abs() } }) - - return abs }) diff --git a/src/function/arithmetic/add.js b/src/function/arithmetic/add.js index 9e3d9bf35e..68dfb27007 100644 --- a/src/function/arithmetic/add.js +++ b/src/function/arithmetic/add.js @@ -1,10 +1,10 @@ -import { factory } from '../../utils/factory' -import { extend } from '../../utils/object' -import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01' -import { createAlgorithm04 } from '../../type/matrix/utils/algorithm04' -import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' +import { factory } from '../../utils/factory.js' +import { extend } from '../../utils/object.js' +import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01.js' +import { createAlgorithm04 } from '../../type/matrix/utils/algorithm04.js' +import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' const name = 'add' const dependencies = [ @@ -57,7 +57,7 @@ export const createAdd = /* #__PURE__ */ factory(name, dependencies, ({ typed, m * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Second value to add * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Sum of `x` and `y` */ - const add = typed(name, extend({ + return typed(name, extend({ // we extend the signatures of addScalar with signatures dealing with matrices 'DenseMatrix, DenseMatrix': function (x, y) { @@ -78,17 +78,17 @@ export const createAdd = /* #__PURE__ */ factory(name, dependencies, ({ typed, m 'Array, Array': function (x, y) { // use matrix implementation - return add(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return add(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return add(x, matrix(y)) + return this(x, matrix(y)) }, 'DenseMatrix, any': function (x, y) { @@ -120,15 +120,13 @@ export const createAdd = /* #__PURE__ */ factory(name, dependencies, ({ typed, m 'any, any': addScalar, 'any, any, ...any': function (x, y, rest) { - let result = add(x, y) + let result = this(x, y) for (let i = 0; i < rest.length; i++) { - result = add(result, rest[i]) + result = this(result, rest[i]) } return result } }, addScalar.signatures)) - - return add }) diff --git a/src/function/arithmetic/addScalar.js b/src/function/arithmetic/addScalar.js index c91e6d2201..79ba8c0fa3 100644 --- a/src/function/arithmetic/addScalar.js +++ b/src/function/arithmetic/addScalar.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { addNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { addNumber } from '../../plain/number/index.js' const name = 'addScalar' const dependencies = ['typed'] @@ -17,7 +17,7 @@ export const createAddScalar = /* #__PURE__ */ factory(name, dependencies, ({ ty * @return {number | BigNumber | Fraction | Complex | Unit} Sum of `x` and `y` * @private */ - const addScalar = typed(name, { + return typed(name, { 'number, number': addNumber, @@ -39,11 +39,9 @@ export const createAddScalar = /* #__PURE__ */ factory(name, dependencies, ({ ty if (!x.equalBase(y)) throw new Error('Units do not match') const res = x.clone() - res.value = addScalar(res.value, y.value) + res.value = this(res.value, y.value) res.fixPrefix = false return res } }) - - return addScalar }) diff --git a/src/function/arithmetic/cbrt.js b/src/function/arithmetic/cbrt.js index 897c36f7d3..1d90caa8cf 100644 --- a/src/function/arithmetic/cbrt.js +++ b/src/function/arithmetic/cbrt.js @@ -1,7 +1,7 @@ -import { factory } from '../../utils/factory' -import { isBigNumber, isComplex, isFraction } from '../../utils/is' -import { deepMap } from '../../utils/collection' -import { cbrtNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { isBigNumber, isComplex, isFraction } from '../../utils/is.js' +import { deepMap } from '../../utils/collection.js' +import { cbrtNumber } from '../../plain/number/index.js' const name = 'cbrt' const dependencies = [ @@ -55,7 +55,7 @@ export const createCbrt = /* #__PURE__ */ factory(name, dependencies, ({ config, * @return {number | BigNumber | Complex | Unit | Array | Matrix} * Returns the cubic root of `x` */ - const cbrt = typed(name, { + return typed(name, { number: cbrtNumber, // note: signature 'number, boolean' is also supported, // created by typed as it knows how to convert number to Complex @@ -72,7 +72,7 @@ export const createCbrt = /* #__PURE__ */ factory(name, dependencies, ({ config, 'Array | Matrix': function (x) { // deep map collection, skip zeros since cbrt(0) = 0 - return deepMap(x, cbrt, true) + return deepMap(x, this, true) } }) @@ -145,6 +145,4 @@ export const createCbrt = /* #__PURE__ */ factory(name, dependencies, ({ config, return result } } - - return cbrt }) diff --git a/src/function/arithmetic/ceil.js b/src/function/arithmetic/ceil.js index 0d8e7546a6..eec7bf3464 100644 --- a/src/function/arithmetic/ceil.js +++ b/src/function/arithmetic/ceil.js @@ -1,8 +1,8 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { nearlyEqual } from '../../utils/number' -import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual' -import { ceilNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { nearlyEqual } from '../../utils/number.js' +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js' +import { ceilNumber } from '../../plain/number/index.js' const name = 'ceil' const dependencies = ['typed', 'config', 'round'] @@ -36,7 +36,7 @@ export const createCeil = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value */ - const ceil = typed('ceil', { + return typed('ceil', { number: function (x) { if (nearlyEqual(x, round(x), config.epsilon)) { return round(x) @@ -63,9 +63,7 @@ export const createCeil = /* #__PURE__ */ factory(name, dependencies, ({ typed, 'Array | Matrix': function (x) { // deep map collection, skip zeros since ceil(0) = 0 - return deepMap(x, ceil, true) + return deepMap(x, this, true) } }) - - return ceil }) diff --git a/src/function/arithmetic/cube.js b/src/function/arithmetic/cube.js index 5f0ef9d79b..22814a78a9 100644 --- a/src/function/arithmetic/cube.js +++ b/src/function/arithmetic/cube.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { cubeNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { cubeNumber } from '../../plain/number/index.js' const name = 'cube' const dependencies = ['typed'] @@ -30,7 +30,7 @@ export const createCube = /* #__PURE__ */ factory(name, dependencies, ({ typed } * @param {number | BigNumber | Fraction | Complex | Array | Matrix | Unit} x Number for which to calculate the cube * @return {number | BigNumber | Fraction | Complex | Array | Matrix | Unit} Cube of x */ - const cube = typed(name, { + return typed(name, { number: cubeNumber, Complex: function (x) { @@ -47,13 +47,11 @@ export const createCube = /* #__PURE__ */ factory(name, dependencies, ({ typed } 'Array | Matrix': function (x) { // deep map collection, skip zeros since cube(0) = 0 - return deepMap(x, cube, true) + return deepMap(x, this, true) }, Unit: function (x) { return x.pow(3) } }) - - return cube }) diff --git a/src/function/arithmetic/divide.js b/src/function/arithmetic/divide.js index 0aa972e94d..214eaa3e39 100644 --- a/src/function/arithmetic/divide.js +++ b/src/function/arithmetic/divide.js @@ -1,7 +1,7 @@ -import { factory } from '../../utils/factory' -import { extend } from '../../utils/object' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' +import { factory } from '../../utils/factory.js' +import { extend } from '../../utils/object.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' const name = 'divide' const dependencies = [ diff --git a/src/function/arithmetic/divideScalar.js b/src/function/arithmetic/divideScalar.js index 20db084519..cd50e319f4 100644 --- a/src/function/arithmetic/divideScalar.js +++ b/src/function/arithmetic/divideScalar.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { typeOf } from '../../utils/is' +import { factory } from '../../utils/factory.js' +import { typeOf } from '../../utils/is.js' const name = 'divideScalar' const dependencies = ['typed', 'numeric'] @@ -17,7 +17,7 @@ export const createDivideScalar = /* #__PURE__ */ factory(name, dependencies, ({ * @return {number | BigNumber | Fraction | Complex | Unit} Quotient, `x / y` * @private */ - const divideScalar = typed(name, { + return typed(name, { 'number, number': function (x, y) { return x / y }, @@ -38,7 +38,7 @@ export const createDivideScalar = /* #__PURE__ */ factory(name, dependencies, ({ const res = x.clone() // TODO: move the divide function to Unit.js, it uses internals of Unit const one = numeric(1, typeOf(y)) - res.value = divideScalar(((res.value === null) ? res._normalize(one) : res.value), y) + res.value = this(((res.value === null) ? res._normalize(one) : res.value), y) return res }, @@ -47,7 +47,7 @@ export const createDivideScalar = /* #__PURE__ */ factory(name, dependencies, ({ res = res.pow(-1) // TODO: move the divide function to Unit.js, it uses internals of Unit const one = numeric(1, typeOf(x)) - res.value = divideScalar(x, ((y.value === null) ? y._normalize(one) : y.value)) + res.value = this(x, ((y.value === null) ? y._normalize(one) : y.value)) return res }, @@ -55,6 +55,4 @@ export const createDivideScalar = /* #__PURE__ */ factory(name, dependencies, ({ return x.divide(y) } }) - - return divideScalar }) diff --git a/src/function/arithmetic/dotDivide.js b/src/function/arithmetic/dotDivide.js index e220b67920..12e380d986 100644 --- a/src/function/arithmetic/dotDivide.js +++ b/src/function/arithmetic/dotDivide.js @@ -1,11 +1,11 @@ -import { factory } from '../../utils/factory' -import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02' -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' +import { factory } from '../../utils/factory.js' +import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02.js' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' const name = 'dotDivide' const dependencies = [ @@ -51,7 +51,7 @@ export const createDotDivide = /* #__PURE__ */ factory(name, dependencies, ({ ty * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Denominator * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Quotient, `x ./ y` */ - const dotDivide = typed(name, { + return typed(name, { 'any, any': divideScalar, @@ -73,17 +73,17 @@ export const createDotDivide = /* #__PURE__ */ factory(name, dependencies, ({ ty 'Array, Array': function (x, y) { // use matrix implementation - return dotDivide(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return dotDivide(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return dotDivide(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { @@ -112,6 +112,4 @@ export const createDotDivide = /* #__PURE__ */ factory(name, dependencies, ({ ty return algorithm14(matrix(y), x, divideScalar, true).valueOf() } }) - - return dotDivide }) diff --git a/src/function/arithmetic/dotMultiply.js b/src/function/arithmetic/dotMultiply.js index 494ececaae..6a43d61500 100644 --- a/src/function/arithmetic/dotMultiply.js +++ b/src/function/arithmetic/dotMultiply.js @@ -1,9 +1,9 @@ -import { factory } from '../../utils/factory' -import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02' -import { createAlgorithm09 } from '../../type/matrix/utils/algorithm09' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' +import { factory } from '../../utils/factory.js' +import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02.js' +import { createAlgorithm09 } from '../../type/matrix/utils/algorithm09.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' const name = 'dotMultiply' const dependencies = [ @@ -46,7 +46,7 @@ export const createDotMultiply = /* #__PURE__ */ factory(name, dependencies, ({ * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Right hand value * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y` */ - const dotMultiply = typed(name, { + return typed(name, { 'any, any': multiplyScalar, @@ -68,17 +68,17 @@ export const createDotMultiply = /* #__PURE__ */ factory(name, dependencies, ({ 'Array, Array': function (x, y) { // use matrix implementation - return dotMultiply(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return dotMultiply(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return dotMultiply(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { @@ -107,6 +107,4 @@ export const createDotMultiply = /* #__PURE__ */ factory(name, dependencies, ({ return algorithm14(matrix(y), x, multiplyScalar, true).valueOf() } }) - - return dotMultiply }) diff --git a/src/function/arithmetic/dotPow.js b/src/function/arithmetic/dotPow.js index 06ea589129..74f2793136 100644 --- a/src/function/arithmetic/dotPow.js +++ b/src/function/arithmetic/dotPow.js @@ -1,10 +1,10 @@ -import { factory } from '../../utils/factory' -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' +import { factory } from '../../utils/factory.js' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' const name = 'dotPow' const dependencies = [ @@ -46,7 +46,7 @@ export const createDotPow = /* #__PURE__ */ factory(name, dependencies, ({ typed * @param {number | BigNumber | Complex | Unit | Array | Matrix} y The exponent * @return {number | BigNumber | Complex | Unit | Array | Matrix} The value of `x` to the power `y` */ - const dotPow = typed(name, { + return typed(name, { 'any, any': pow, @@ -68,45 +68,43 @@ export const createDotPow = /* #__PURE__ */ factory(name, dependencies, ({ typed 'Array, Array': function (x, y) { // use matrix implementation - return dotPow(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return dotPow(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return dotPow(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { - return algorithm11(x, y, dotPow, false) + return algorithm11(x, y, this, false) }, 'DenseMatrix, any': function (x, y) { - return algorithm14(x, y, dotPow, false) + return algorithm14(x, y, this, false) }, 'any, SparseMatrix': function (x, y) { - return algorithm12(y, x, dotPow, true) + return algorithm12(y, x, this, true) }, 'any, DenseMatrix': function (x, y) { - return algorithm14(y, x, dotPow, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, dotPow, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, dotPow, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return dotPow }) diff --git a/src/function/arithmetic/exp.js b/src/function/arithmetic/exp.js index c8d9f3f7e1..606c885f1e 100644 --- a/src/function/arithmetic/exp.js +++ b/src/function/arithmetic/exp.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { expNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { expNumber } from '../../plain/number/index.js' const name = 'exp' const dependencies = ['typed'] @@ -34,7 +34,7 @@ export const createExp = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @param {number | BigNumber | Complex | Array | Matrix} x A number or matrix to exponentiate * @return {number | BigNumber | Complex | Array | Matrix} Exponent of `x` */ - const exp = typed(name, { + return typed(name, { number: expNumber, Complex: function (x) { @@ -47,9 +47,7 @@ export const createExp = /* #__PURE__ */ factory(name, dependencies, ({ typed }) 'Array | Matrix': function (x) { // TODO: exp(sparse) should return a dense matrix since exp(0)==1 - return deepMap(x, exp) + return deepMap(x, this) } }) - - return exp }) diff --git a/src/function/arithmetic/expm1.js b/src/function/arithmetic/expm1.js index ad9e7bd7da..37845015f7 100644 --- a/src/function/arithmetic/expm1.js +++ b/src/function/arithmetic/expm1.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { expm1Number } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { expm1Number } from '../../plain/number/index.js' const name = 'expm1' const dependencies = ['typed', 'Complex'] @@ -34,7 +34,7 @@ export const createExpm1 = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | BigNumber | Complex | Array | Matrix} x A number or matrix to apply expm1 * @return {number | BigNumber | Complex | Array | Matrix} Exponent of `x` */ - const expm1 = typed(name, { + return typed(name, { number: expm1Number, Complex: function (x) { @@ -50,9 +50,7 @@ export const createExpm1 = /* #__PURE__ */ factory(name, dependencies, ({ typed, }, 'Array | Matrix': function (x) { - return deepMap(x, expm1) + return deepMap(x, this) } }) - - return expm1 }) diff --git a/src/function/arithmetic/fix.js b/src/function/arithmetic/fix.js index 8b4d14528f..8f300a9707 100644 --- a/src/function/arithmetic/fix.js +++ b/src/function/arithmetic/fix.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' const name = 'fix' const dependencies = ['typed', 'Complex', 'ceil', 'floor'] @@ -32,7 +32,7 @@ export const createFix = /* #__PURE__ */ factory(name, dependencies, ({ typed, C * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value */ - const fix = typed('fix', { + return typed('fix', { number: function (x) { return (x > 0) ? floor(x) : ceil(x) }, @@ -54,9 +54,7 @@ export const createFix = /* #__PURE__ */ factory(name, dependencies, ({ typed, C 'Array | Matrix': function (x) { // deep map collection, skip zeros since fix(0) = 0 - return deepMap(x, fix, true) + return deepMap(x, this, true) } }) - - return fix }) diff --git a/src/function/arithmetic/floor.js b/src/function/arithmetic/floor.js index 6347714184..70125b13fa 100644 --- a/src/function/arithmetic/floor.js +++ b/src/function/arithmetic/floor.js @@ -1,7 +1,7 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { nearlyEqual } from '../../utils/number' -import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { nearlyEqual } from '../../utils/number.js' +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js' const name = 'floor' const dependencies = ['typed', 'config', 'round'] @@ -34,7 +34,7 @@ export const createFloor = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value */ - const floor = typed('floor', { + return typed('floor', { number: function (x) { if (nearlyEqual(x, round(x), config.epsilon)) { return round(x) @@ -61,9 +61,7 @@ export const createFloor = /* #__PURE__ */ factory(name, dependencies, ({ typed, 'Array | Matrix': function (x) { // deep map collection, skip zeros since floor(0) = 0 - return deepMap(x, floor, true) + return deepMap(x, this, true) } }) - - return floor }) diff --git a/src/function/arithmetic/gcd.js b/src/function/arithmetic/gcd.js index 0293a5e6dc..440565008a 100644 --- a/src/function/arithmetic/gcd.js +++ b/src/function/arithmetic/gcd.js @@ -1,10 +1,10 @@ -import { factory } from '../../utils/factory' -import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01' -import { createAlgorithm04 } from '../../type/matrix/utils/algorithm04' -import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { gcdNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01.js' +import { createAlgorithm04 } from '../../type/matrix/utils/algorithm04.js' +import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { gcdNumber } from '../../plain/number/index.js' const name = 'gcd' const dependencies = [ @@ -47,7 +47,7 @@ export const createGcd = /* #__PURE__ */ factory(name, dependencies, ({ typed, m * @param {... number | BigNumber | Fraction | Array | Matrix} args Two or more integer numbers * @return {number | BigNumber | Fraction | Array | Matrix} The greatest common divisor */ - const gcd = typed(name, { + return typed(name, { 'number, number': gcdNumber, @@ -58,74 +58,72 @@ export const createGcd = /* #__PURE__ */ factory(name, dependencies, ({ typed, m }, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm04(x, y, gcd) + return algorithm04(x, y, this) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm01(y, x, gcd, true) + return algorithm01(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm01(x, y, gcd, false) + return algorithm01(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, gcd) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return gcd(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return gcd(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return gcd(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, number | BigNumber': function (x, y) { - return algorithm10(x, y, gcd, false) + return algorithm10(x, y, this, false) }, 'DenseMatrix, number | BigNumber': function (x, y) { - return algorithm14(x, y, gcd, false) + return algorithm14(x, y, this, false) }, 'number | BigNumber, SparseMatrix': function (x, y) { - return algorithm10(y, x, gcd, true) + return algorithm10(y, x, this, true) }, 'number | BigNumber, DenseMatrix': function (x, y) { - return algorithm14(y, x, gcd, true) + return algorithm14(y, x, this, true) }, 'Array, number | BigNumber': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, gcd, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'number | BigNumber, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, gcd, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() }, // TODO: need a smarter notation here 'Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber': function (a, b, args) { - let res = gcd(a, b) + let res = this(a, b) for (let i = 0; i < args.length; i++) { - res = gcd(res, args[i]) + res = this(res, args[i]) } return res } }) - return gcd - /** * Calculate gcd for BigNumbers * @param {BigNumber} a diff --git a/src/function/arithmetic/hypot.js b/src/function/arithmetic/hypot.js index 1e7fc4ce14..9b4dd06784 100644 --- a/src/function/arithmetic/hypot.js +++ b/src/function/arithmetic/hypot.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { flatten } from '../../utils/array' +import { factory } from '../../utils/factory.js' +import { flatten } from '../../utils/array.js' const name = 'hypot' const dependencies = [ @@ -42,15 +42,15 @@ export const createHypot = /* #__PURE__ */ factory(name, dependencies, ({ typed, * single number for the whole matrix. * @return {number | BigNumber} Returns the hypothenusa of the input values. */ - const hypot = typed(name, { + return typed(name, { '... number | BigNumber': _hypot, Array: function (x) { - return hypot.apply(hypot, flatten(x)) + return this.apply(this, flatten(x)) }, Matrix: function (x) { - return hypot.apply(hypot, flatten(x.toArray())) + return this.apply(this, flatten(x.toArray())) } }) @@ -82,6 +82,4 @@ export const createHypot = /* #__PURE__ */ factory(name, dependencies, ({ typed, return multiplyScalar(largest, sqrt(result)) } - - return hypot }) diff --git a/src/function/arithmetic/index.js b/src/function/arithmetic/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/arithmetic/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/arithmetic/lcm.js b/src/function/arithmetic/lcm.js index 3c4a2a7947..997fe98502 100644 --- a/src/function/arithmetic/lcm.js +++ b/src/function/arithmetic/lcm.js @@ -1,10 +1,10 @@ -import { factory } from '../../utils/factory' -import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02' -import { createAlgorithm06 } from '../../type/matrix/utils/algorithm06' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { lcmNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02.js' +import { createAlgorithm06 } from '../../type/matrix/utils/algorithm06.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { lcmNumber } from '../../plain/number/index.js' const name = 'lcm' const dependencies = [ @@ -49,7 +49,7 @@ export const createLcm = /* #__PURE__ */ factory(name, dependencies, ({ typed, m * @param {... number | BigNumber | Array | Matrix} args Two or more integer numbers * @return {number | BigNumber | Array | Matrix} The least common multiple */ - const lcm = typed(name, { + return typed(name, { 'number, number': lcmNumber, 'BigNumber, BigNumber': _lcmBigNumber, @@ -59,74 +59,72 @@ export const createLcm = /* #__PURE__ */ factory(name, dependencies, ({ typed, m }, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm06(x, y, lcm) + return algorithm06(x, y, this) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm02(y, x, lcm, true) + return algorithm02(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm02(x, y, lcm, false) + return algorithm02(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, lcm) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return lcm(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return lcm(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return lcm(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, number | BigNumber': function (x, y) { - return algorithm11(x, y, lcm, false) + return algorithm11(x, y, this, false) }, 'DenseMatrix, number | BigNumber': function (x, y) { - return algorithm14(x, y, lcm, false) + return algorithm14(x, y, this, false) }, 'number | BigNumber, SparseMatrix': function (x, y) { - return algorithm11(y, x, lcm, true) + return algorithm11(y, x, this, true) }, 'number | BigNumber, DenseMatrix': function (x, y) { - return algorithm14(y, x, lcm, true) + return algorithm14(y, x, this, true) }, 'Array, number | BigNumber': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, lcm, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'number | BigNumber, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, lcm, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() }, // TODO: need a smarter notation here 'Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber': function (a, b, args) { - let res = lcm(a, b) + let res = this(a, b) for (let i = 0; i < args.length; i++) { - res = lcm(res, args[i]) + res = this(res, args[i]) } return res } }) - return lcm - /** * Calculate lcm for two BigNumbers * @param {BigNumber} a diff --git a/src/function/arithmetic/log.js b/src/function/arithmetic/log.js index 620600ffcc..ad7b54ea36 100644 --- a/src/function/arithmetic/log.js +++ b/src/function/arithmetic/log.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { logNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { logNumber } from '../../plain/number/index.js' const name = 'log' const dependencies = ['config', 'typed', 'divideScalar', 'Complex'] @@ -40,7 +40,7 @@ export const createLog = /* #__PURE__ */ factory(name, dependencies, ({ typed, c * @return {number | BigNumber | Complex | Array | Matrix} * Returns the logarithm of `x` */ - const log = typed(name, { + return typed(name, { number: function (x) { if (x >= 0 || config.predictable) { return logNumber(x) @@ -64,14 +64,12 @@ export const createLog = /* #__PURE__ */ factory(name, dependencies, ({ typed, c }, 'Array | Matrix': function (x) { - return deepMap(x, log) + return deepMap(x, this) }, 'any, any': function (x, base) { // calculate logarithm for a specified base, log(x, base) - return divideScalar(log(x), log(base)) + return divideScalar(this(x), this(base)) } }) - - return log }) diff --git a/src/function/arithmetic/log10.js b/src/function/arithmetic/log10.js index 6a87dbd5d9..998b2a97ce 100644 --- a/src/function/arithmetic/log10.js +++ b/src/function/arithmetic/log10.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { log10Number } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { log10Number } from '../../plain/number/index.js' const name = 'log10' const dependencies = ['typed', 'config', 'Complex'] @@ -31,7 +31,7 @@ export const createLog10 = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | BigNumber | Complex | Array | Matrix} * Returns the 10-base logarithm of `x` */ - const log10 = typed(name, { + return typed(name, { number: function (x) { if (x >= 0 || config.predictable) { return log10Number(x) @@ -55,9 +55,7 @@ export const createLog10 = /* #__PURE__ */ factory(name, dependencies, ({ typed, }, 'Array | Matrix': function (x) { - return deepMap(x, log10) + return deepMap(x, this) } }) - - return log10 }) diff --git a/src/function/arithmetic/log1p.js b/src/function/arithmetic/log1p.js index 6523221e0c..c036cdafe1 100644 --- a/src/function/arithmetic/log1p.js +++ b/src/function/arithmetic/log1p.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { log1p as _log1p } from '../../utils/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { log1p as _log1p } from '../../utils/number.js' const name = 'log1p' const dependencies = ['typed', 'config', 'divideScalar', 'log', 'Complex'] @@ -37,7 +37,7 @@ export const createLog1p = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | BigNumber | Complex | Array | Matrix} * Returns the logarithm of `x+1` */ - const log1p = typed(name, { + return typed(name, { number: function (x) { if (x >= -1 || config.predictable) { return _log1p(x) @@ -60,12 +60,12 @@ export const createLog1p = /* #__PURE__ */ factory(name, dependencies, ({ typed, }, 'Array | Matrix': function (x) { - return deepMap(x, log1p) + return deepMap(x, this) }, 'any, any': function (x, base) { // calculate logarithm for a specified base, log1p(x, base) - return divideScalar(log1p(x), log(base)) + return divideScalar(this(x), log(base)) } }) @@ -82,6 +82,4 @@ export const createLog1p = /* #__PURE__ */ factory(name, dependencies, ({ typed, Math.atan2(x.im, xRe1p) ) } - - return log1p }) diff --git a/src/function/arithmetic/log2.js b/src/function/arithmetic/log2.js index f30568390d..de3b96c331 100644 --- a/src/function/arithmetic/log2.js +++ b/src/function/arithmetic/log2.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { log2Number } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { log2Number } from '../../plain/number/index.js' const name = 'log2' const dependencies = ['typed', 'config', 'Complex'] @@ -31,7 +31,7 @@ export const createLog2 = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | BigNumber | Complex | Array | Matrix} * Returns the 2-base logarithm of `x` */ - const log2 = typed(name, { + return typed(name, { number: function (x) { if (x >= 0 || config.predictable) { return log2Number(x) @@ -53,7 +53,7 @@ export const createLog2 = /* #__PURE__ */ factory(name, dependencies, ({ typed, }, 'Array | Matrix': function (x) { - return deepMap(x, log2) + return deepMap(x, this) } }) @@ -70,6 +70,4 @@ export const createLog2 = /* #__PURE__ */ factory(name, dependencies, ({ typed, Math.atan2(x.im, x.re) / Math.LN2 ) } - - return log2 }) diff --git a/src/function/arithmetic/mod.js b/src/function/arithmetic/mod.js index 822096f47e..8601a4c285 100644 --- a/src/function/arithmetic/mod.js +++ b/src/function/arithmetic/mod.js @@ -1,12 +1,12 @@ -import { factory } from '../../utils/factory' -import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02' -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm05 } from '../../type/matrix/utils/algorithm05' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { modNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02.js' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm05 } from '../../type/matrix/utils/algorithm05.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { modNumber } from '../../plain/number/index.js' const name = 'mod' const dependencies = [ @@ -60,7 +60,7 @@ export const createMod = /* #__PURE__ */ factory(name, dependencies, ({ typed, m * @param {number | BigNumber | Fraction | Array | Matrix} y Divisor * @return {number | BigNumber | Fraction | Array | Matrix} Returns the remainder of `x` divided by `y`. */ - const mod = typed(name, { + return typed(name, { 'number, number': modNumber, @@ -73,62 +73,60 @@ export const createMod = /* #__PURE__ */ factory(name, dependencies, ({ typed, m }, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm05(x, y, mod, false) + return algorithm05(x, y, this, false) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm02(y, x, mod, true) + return algorithm02(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm03(x, y, mod, false) + return algorithm03(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, mod) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return mod(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return mod(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return mod(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { - return algorithm11(x, y, mod, false) + return algorithm11(x, y, this, false) }, 'DenseMatrix, any': function (x, y) { - return algorithm14(x, y, mod, false) + return algorithm14(x, y, this, false) }, 'any, SparseMatrix': function (x, y) { - return algorithm12(y, x, mod, true) + return algorithm12(y, x, this, true) }, 'any, DenseMatrix': function (x, y) { - return algorithm14(y, x, mod, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, mod, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, mod, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return mod }) diff --git a/src/function/arithmetic/multiply.js b/src/function/arithmetic/multiply.js index 4ea04a1da7..739cd4b591 100644 --- a/src/function/arithmetic/multiply.js +++ b/src/function/arithmetic/multiply.js @@ -1,9 +1,9 @@ -import { factory } from '../../utils/factory' -import { isMatrix } from '../../utils/is' -import { extend } from '../../utils/object' -import { arraySize } from '../../utils/array' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' +import { factory } from '../../utils/factory.js' +import { isMatrix } from '../../utils/is.js' +import { extend } from '../../utils/object.js' +import { arraySize } from '../../utils/array.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' const name = 'multiply' const dependencies = [ @@ -11,135 +11,14 @@ const dependencies = [ 'matrix', 'addScalar', 'multiplyScalar', - 'equalScalar' + 'equalScalar', + 'dot' ] -export const createMultiply = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, addScalar, multiplyScalar, equalScalar }) => { +export const createMultiply = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, addScalar, multiplyScalar, equalScalar, dot }) => { const algorithm11 = createAlgorithm11({ typed, equalScalar }) const algorithm14 = createAlgorithm14({ typed }) - /** - * Multiply two or more values, `x * y`. - * For matrices, the matrix product is calculated. - * - * Syntax: - * - * math.multiply(x, y) - * math.multiply(x, y, z, ...) - * - * Examples: - * - * math.multiply(4, 5.2) // returns number 20.8 - * math.multiply(2, 3, 4) // returns number 24 - * - * const a = math.complex(2, 3) - * const b = math.complex(4, 1) - * math.multiply(a, b) // returns Complex 5 + 14i - * - * const c = [[1, 2], [4, 3]] - * const d = [[1, 2, 3], [3, -4, 7]] - * math.multiply(c, d) // returns Array [[7, -6, 17], [13, -4, 33]] - * - * const e = math.unit('2.1 km') - * math.multiply(3, e) // returns Unit 6.3 km - * - * See also: - * - * divide, prod, cross, dot - * - * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x First value to multiply - * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Second value to multiply - * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y` - */ - const multiply = typed(name, extend({ - // we extend the signatures of multiplyScalar with signatures dealing with matrices - - 'Array, Array': function (x, y) { - // check dimensions - _validateMatrixDimensions(arraySize(x), arraySize(y)) - - // use dense matrix implementation - const m = multiply(matrix(x), matrix(y)) - // return array or scalar - return isMatrix(m) ? m.valueOf() : m - }, - - 'Matrix, Matrix': function (x, y) { - // dimensions - const xsize = x.size() - const ysize = y.size() - - // check dimensions - _validateMatrixDimensions(xsize, ysize) - - // process dimensions - if (xsize.length === 1) { - // process y dimensions - if (ysize.length === 1) { - // Vector * Vector - return _multiplyVectorVector(x, y, xsize[0]) - } - // Vector * Matrix - return _multiplyVectorMatrix(x, y) - } - // process y dimensions - if (ysize.length === 1) { - // Matrix * Vector - return _multiplyMatrixVector(x, y) - } - // Matrix * Matrix - return _multiplyMatrixMatrix(x, y) - }, - - 'Matrix, Array': function (x, y) { - // use Matrix * Matrix implementation - return multiply(x, matrix(y)) - }, - - 'Array, Matrix': function (x, y) { - // use Matrix * Matrix implementation - return multiply(matrix(x, y.storage()), y) - }, - - 'SparseMatrix, any': function (x, y) { - return algorithm11(x, y, multiplyScalar, false) - }, - - 'DenseMatrix, any': function (x, y) { - return algorithm14(x, y, multiplyScalar, false) - }, - - 'any, SparseMatrix': function (x, y) { - return algorithm11(y, x, multiplyScalar, true) - }, - - 'any, DenseMatrix': function (x, y) { - return algorithm14(y, x, multiplyScalar, true) - }, - - 'Array, any': function (x, y) { - // use matrix implementation - return algorithm14(matrix(x), y, multiplyScalar, false).valueOf() - }, - - 'any, Array': function (x, y) { - // use matrix implementation - return algorithm14(matrix(y), x, multiplyScalar, true).valueOf() - }, - - 'any, any': multiplyScalar, - - 'any, any, ...any': function (x, y, rest) { - let result = multiply(x, y) - - for (let i = 0; i < rest.length; i++) { - result = multiply(result, rest[i]) - } - - return result - } - }, multiplyScalar.signatures)) - function _validateMatrixDimensions (size1, size2) { // check left operand dimensions switch (size1.length) { @@ -201,38 +80,7 @@ export const createMultiply = /* #__PURE__ */ factory(name, dependencies, ({ typ function _multiplyVectorVector (a, b, n) { // check empty vector if (n === 0) { throw new Error('Cannot multiply two empty vectors') } - - // a dense - const adata = a._data - const adt = a._datatype - // b dense - const bdata = b._data - const bdt = b._datatype - - // datatype - let dt - // addScalar signature to use - let af = addScalar - // multiplyScalar signature to use - let mf = multiplyScalar - - // process data types - if (adt && bdt && adt === bdt && typeof adt === 'string') { - // datatype - dt = adt - // find signatures that matches (dt, dt) - af = typed.find(addScalar, [dt, dt]) - mf = typed.find(multiplyScalar, [dt, dt]) - } - - // result (do not initialize it with zero) - let c = mf(adata[0], bdata[0]) - // loop data - for (let i = 1; i < n; i++) { - // multiply and accumulate - c = af(c, mf(adata[i], bdata[i])) - } - return c + return dot(a, b) } /** @@ -913,5 +761,125 @@ export const createMultiply = /* #__PURE__ */ factory(name, dependencies, ({ typ return c } - return multiply + /** + * Multiply two or more values, `x * y`. + * For matrices, the matrix product is calculated. + * + * Syntax: + * + * math.multiply(x, y) + * math.multiply(x, y, z, ...) + * + * Examples: + * + * math.multiply(4, 5.2) // returns number 20.8 + * math.multiply(2, 3, 4) // returns number 24 + * + * const a = math.complex(2, 3) + * const b = math.complex(4, 1) + * math.multiply(a, b) // returns Complex 5 + 14i + * + * const c = [[1, 2], [4, 3]] + * const d = [[1, 2, 3], [3, -4, 7]] + * math.multiply(c, d) // returns Array [[7, -6, 17], [13, -4, 33]] + * + * const e = math.unit('2.1 km') + * math.multiply(3, e) // returns Unit 6.3 km + * + * See also: + * + * divide, prod, cross, dot + * + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x First value to multiply + * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Second value to multiply + * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y` + */ + return typed(name, extend({ + // we extend the signatures of multiplyScalar with signatures dealing with matrices + + 'Array, Array': function (x, y) { + // check dimensions + _validateMatrixDimensions(arraySize(x), arraySize(y)) + + // use dense matrix implementation + const m = this(matrix(x), matrix(y)) + // return array or scalar + return isMatrix(m) ? m.valueOf() : m + }, + + 'Matrix, Matrix': function (x, y) { + // dimensions + const xsize = x.size() + const ysize = y.size() + + // check dimensions + _validateMatrixDimensions(xsize, ysize) + + // process dimensions + if (xsize.length === 1) { + // process y dimensions + if (ysize.length === 1) { + // Vector * Vector + return _multiplyVectorVector(x, y, xsize[0]) + } + // Vector * Matrix + return _multiplyVectorMatrix(x, y) + } + // process y dimensions + if (ysize.length === 1) { + // Matrix * Vector + return _multiplyMatrixVector(x, y) + } + // Matrix * Matrix + return _multiplyMatrixMatrix(x, y) + }, + + 'Matrix, Array': function (x, y) { + // use Matrix * Matrix implementation + return this(x, matrix(y)) + }, + + 'Array, Matrix': function (x, y) { + // use Matrix * Matrix implementation + return this(matrix(x, y.storage()), y) + }, + + 'SparseMatrix, any': function (x, y) { + return algorithm11(x, y, multiplyScalar, false) + }, + + 'DenseMatrix, any': function (x, y) { + return algorithm14(x, y, multiplyScalar, false) + }, + + 'any, SparseMatrix': function (x, y) { + return algorithm11(y, x, multiplyScalar, true) + }, + + 'any, DenseMatrix': function (x, y) { + return algorithm14(y, x, multiplyScalar, true) + }, + + 'Array, any': function (x, y) { + // use matrix implementation + return algorithm14(matrix(x), y, multiplyScalar, false).valueOf() + }, + + 'any, Array': function (x, y) { + // use matrix implementation + return algorithm14(matrix(y), x, multiplyScalar, true).valueOf() + }, + + 'any, any': multiplyScalar, + + 'any, any, ...any': function (x, y, rest) { + let result = this(x, y) + + for (let i = 0; i < rest.length; i++) { + result = this(result, rest[i]) + } + + return result + } + }, multiplyScalar.signatures)) }) diff --git a/src/function/arithmetic/multiplyScalar.js b/src/function/arithmetic/multiplyScalar.js index 331e781ba3..e0734f2f28 100644 --- a/src/function/arithmetic/multiplyScalar.js +++ b/src/function/arithmetic/multiplyScalar.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { multiplyNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { multiplyNumber } from '../../plain/number/index.js' const name = 'multiplyScalar' const dependencies = ['typed'] @@ -17,7 +17,7 @@ export const createMultiplyScalar = /* #__PURE__ */ factory(name, dependencies, * @return {number | BigNumber | Fraction | Complex | Unit} Multiplication of `x` and `y` * @private */ - const multiplyScalar = typed('multiplyScalar', { + return typed('multiplyScalar', { 'number, number': multiplyNumber, @@ -35,13 +35,13 @@ export const createMultiplyScalar = /* #__PURE__ */ factory(name, dependencies, 'number | Fraction | BigNumber | Complex, Unit': function (x, y) { const res = y.clone() - res.value = (res.value === null) ? res._normalize(x) : multiplyScalar(res.value, x) + res.value = (res.value === null) ? res._normalize(x) : this(res.value, x) return res }, 'Unit, number | Fraction | BigNumber | Complex': function (x, y) { const res = x.clone() - res.value = (res.value === null) ? res._normalize(y) : multiplyScalar(res.value, y) + res.value = (res.value === null) ? res._normalize(y) : this(res.value, y) return res }, @@ -50,6 +50,4 @@ export const createMultiplyScalar = /* #__PURE__ */ factory(name, dependencies, } }) - - return multiplyScalar }) diff --git a/src/function/arithmetic/norm.js b/src/function/arithmetic/norm.js index a28e3efbe5..7e2701a069 100644 --- a/src/function/arithmetic/norm.js +++ b/src/function/arithmetic/norm.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'norm' const dependencies = [ @@ -54,7 +54,7 @@ export const createNorm = /* #__PURE__ */ factory(name, dependencies, ({ typed, * Supported strings are: 'inf', '-inf', and 'fro' (The Frobenius norm) * @return {number | BigNumber} the p-norm */ - const norm = typed(name, { + return typed(name, { number: Math.abs, Complex: function (x) { @@ -81,7 +81,7 @@ export const createNorm = /* #__PURE__ */ factory(name, dependencies, ({ typed, 'number | Complex | BigNumber | boolean, number | BigNumber | string': function (x) { // ignore second parameter, TODO: remove the option of second parameter for these types - return norm(x) + return this(x) }, 'Array, number | BigNumber | string': function (x, p) { @@ -204,6 +204,4 @@ export const createNorm = /* #__PURE__ */ factory(name, dependencies, ({ typed, throw new Error('Unsupported parameter value') } } - - return norm }) diff --git a/src/function/arithmetic/nthRoot.js b/src/function/arithmetic/nthRoot.js index e7c3a71a46..695835d1de 100644 --- a/src/function/arithmetic/nthRoot.js +++ b/src/function/arithmetic/nthRoot.js @@ -1,11 +1,11 @@ -import { factory } from '../../utils/factory' -import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01' -import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02' -import { createAlgorithm06 } from '../../type/matrix/utils/algorithm06' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { nthRootNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01.js' +import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02.js' +import { createAlgorithm06 } from '../../type/matrix/utils/algorithm06.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { nthRootNumber } from '../../plain/number/index.js' const name = 'nthRoot' const dependencies = [ @@ -56,7 +56,7 @@ export const createNthRoot = /* #__PURE__ */ factory(name, dependencies, ({ type 'Complex number not supported in function nthRoot. ' + 'Use nthRoots instead.' ) - const nthRoot = typed(name, { + return typed(name, { number: function (x) { return nthRootNumber(x, 2) @@ -76,14 +76,14 @@ export const createNthRoot = /* #__PURE__ */ factory(name, dependencies, ({ type 'BigNumber, BigNumber': _bigNthRoot, 'Array | Matrix': function (x) { - return nthRoot(x, 2) + return this(x, 2) }, 'SparseMatrix, SparseMatrix': function (x, y) { // density must be one (no zeros in matrix) if (y.density() === 1) { // sparse + sparse - return algorithm06(x, y, nthRoot) + return algorithm06(x, y, this) } else { // throw exception throw new Error('Root must be non-zero') @@ -91,14 +91,14 @@ export const createNthRoot = /* #__PURE__ */ factory(name, dependencies, ({ type }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm02(y, x, nthRoot, true) + return algorithm02(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { // density must be one (no zeros in matrix) if (y.density() === 1) { // dense + sparse - return algorithm01(x, y, nthRoot, false) + return algorithm01(x, y, this, false) } else { // throw exception throw new Error('Root must be non-zero') @@ -106,37 +106,37 @@ export const createNthRoot = /* #__PURE__ */ factory(name, dependencies, ({ type }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, nthRoot) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return nthRoot(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return nthRoot(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return nthRoot(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, number | BigNumber': function (x, y) { - return algorithm11(x, y, nthRoot, false) + return algorithm11(x, y, this, false) }, 'DenseMatrix, number | BigNumber': function (x, y) { - return algorithm14(x, y, nthRoot, false) + return algorithm14(x, y, this, false) }, 'number | BigNumber, SparseMatrix': function (x, y) { // density must be one (no zeros in matrix) if (y.density() === 1) { // sparse - scalar - return algorithm11(y, x, nthRoot, true) + return algorithm11(y, x, this, true) } else { // throw exception throw new Error('Root must be non-zero') @@ -144,22 +144,20 @@ export const createNthRoot = /* #__PURE__ */ factory(name, dependencies, ({ type }, 'number | BigNumber, DenseMatrix': function (x, y) { - return algorithm14(y, x, nthRoot, true) + return algorithm14(y, x, this, true) }, 'Array, number | BigNumber': function (x, y) { // use matrix implementation - return nthRoot(matrix(x), y).valueOf() + return this(matrix(x), y).valueOf() }, 'number | BigNumber, Array': function (x, y) { // use matrix implementation - return nthRoot(x, matrix(y)).valueOf() + return this(x, matrix(y)).valueOf() } }) - return nthRoot - /** * Calculate the nth root of a for BigNumbers, solve x^root == a * https://rosettacode.org/wiki/Nth_root#JavaScript diff --git a/src/function/arithmetic/nthRoots.js b/src/function/arithmetic/nthRoots.js index 9931e447b0..089d602229 100644 --- a/src/function/arithmetic/nthRoots.js +++ b/src/function/arithmetic/nthRoots.js @@ -1,48 +1,9 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'nthRoots' const dependencies = ['config', 'typed', 'divideScalar', 'Complex'] export const createNthRoots = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, divideScalar, Complex }) => { - /** - * Calculate the nth roots of a value. - * An nth root of a positive real number A, - * is a positive real solution of the equation "x^root = A". - * This function returns an array of complex values. - * - * Syntax: - * - * math.nthRoots(x) - * math.nthRoots(x, root) - * - * Examples: - * - * math.nthRoots(1) - * // returns [ - * // {re: 1, im: 0}, - * // {re: -1, im: 0} - * // ] - * nthRoots(1, 3) - * // returns [ - * // { re: 1, im: 0 }, - * // { re: -0.4999999999999998, im: 0.8660254037844387 }, - * // { re: -0.5000000000000004, im: -0.8660254037844385 } - * ] - * - * See also: - * - * nthRoot, pow, sqrt - * - * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded - * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value - */ - const nthRoots = typed(name, { - Complex: function (x) { - return _nthComplexRoots(x, 2) - }, - 'Complex, number': _nthComplexRoots - }) - /** * Each function here returns a real multiple of i as a Complex value. * @param {number} val @@ -98,5 +59,42 @@ export const createNthRoots = /* #__PURE__ */ factory(name, dependencies, ({ typ return roots } - return nthRoots + /** + * Calculate the nth roots of a value. + * An nth root of a positive real number A, + * is a positive real solution of the equation "x^root = A". + * This function returns an array of complex values. + * + * Syntax: + * + * math.nthRoots(x) + * math.nthRoots(x, root) + * + * Examples: + * + * math.nthRoots(1) + * // returns [ + * // {re: 1, im: 0}, + * // {re: -1, im: 0} + * // ] + * nthRoots(1, 3) + * // returns [ + * // { re: 1, im: 0 }, + * // { re: -0.4999999999999998, im: 0.8660254037844387 }, + * // { re: -0.5000000000000004, im: -0.8660254037844385 } + * ] + * + * See also: + * + * nthRoot, pow, sqrt + * + * @param {number | BigNumber | Fraction | Complex} x Number to be rounded + * @return {number | BigNumber | Fraction | Complex} Rounded value + */ + return typed(name, { + Complex: function (x) { + return _nthComplexRoots(x, 2) + }, + 'Complex, number': _nthComplexRoots + }) }) diff --git a/src/function/arithmetic/pow.js b/src/function/arithmetic/pow.js index 9ed40ebd76..0039adce00 100644 --- a/src/function/arithmetic/pow.js +++ b/src/function/arithmetic/pow.js @@ -1,7 +1,7 @@ -import { factory } from '../../utils/factory' -import { isInteger } from '../../utils/number' -import { arraySize as size } from '../../utils/array' -import { powNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { isInteger } from '../../utils/number.js' +import { arraySize as size } from '../../utils/array.js' +import { powNumber } from '../../plain/number/index.js' const name = 'pow' const dependencies = [ diff --git a/src/function/arithmetic/round.js b/src/function/arithmetic/round.js index 5fb5521e3b..5052d299a9 100644 --- a/src/function/arithmetic/round.js +++ b/src/function/arithmetic/round.js @@ -1,10 +1,10 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { isInteger } from '../../utils/number' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { roundNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { isInteger } from '../../utils/number.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { roundNumber } from '../../plain/number/index.js' const NO_INT = 'Number of decimals in function round must be an integer' @@ -54,7 +54,7 @@ export const createRound = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | BigNumber | Array} [n=0] Number of decimals * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value */ - const round = typed(name, { + return typed(name, { ...roundNumberSignatures, Complex: function (x) { @@ -101,15 +101,15 @@ export const createRound = /* #__PURE__ */ factory(name, dependencies, ({ typed, 'Array | Matrix': function (x) { // deep map collection, skip zeros since round(0) = 0 - return deepMap(x, round, true) + return deepMap(x, this, true) }, 'SparseMatrix, number | BigNumber': function (x, y) { - return algorithm11(x, y, round, false) + return algorithm11(x, y, this, false) }, 'DenseMatrix, number | BigNumber': function (x, y) { - return algorithm14(x, y, round, false) + return algorithm14(x, y, this, false) }, 'number | Complex | BigNumber, SparseMatrix': function (x, y) { @@ -118,7 +118,7 @@ export const createRound = /* #__PURE__ */ factory(name, dependencies, ({ typed, // do not execute algorithm, result will be a zero matrix return zeros(y.size(), y.storage()) } - return algorithm12(y, x, round, true) + return algorithm12(y, x, this, true) }, 'number | Complex | BigNumber, DenseMatrix': function (x, y) { @@ -127,21 +127,19 @@ export const createRound = /* #__PURE__ */ factory(name, dependencies, ({ typed, // do not execute algorithm, result will be a zero matrix return zeros(y.size(), y.storage()) } - return algorithm14(y, x, round, true) + return algorithm14(y, x, this, true) }, 'Array, number | BigNumber': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, round, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'number | Complex | BigNumber, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, round, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return round }) const roundNumberSignatures = { diff --git a/src/function/arithmetic/sign.js b/src/function/arithmetic/sign.js index 0725aa2312..527b3c8524 100644 --- a/src/function/arithmetic/sign.js +++ b/src/function/arithmetic/sign.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { signNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { signNumber } from '../../plain/number/index.js' const name = 'sign' const dependencies = ['typed', 'BigNumber', 'Fraction', 'complex'] @@ -36,7 +36,7 @@ export const createSign = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | BigNumber | Fraction | Complex | Array | Matrix | Unit}e * The sign of `x` */ - const sign = typed(name, { + return typed(name, { number: signNumber, Complex: function (x) { @@ -53,13 +53,11 @@ export const createSign = /* #__PURE__ */ factory(name, dependencies, ({ typed, 'Array | Matrix': function (x) { // deep map collection, skip zeros since sign(0) = 0 - return deepMap(x, sign, true) + return deepMap(x, this, true) }, Unit: function (x) { - return sign(x.value) + return this(x.value) } }) - - return sign }) diff --git a/src/function/arithmetic/sqrt.js b/src/function/arithmetic/sqrt.js index 982bf6c6bd..6d3b9a34ec 100644 --- a/src/function/arithmetic/sqrt.js +++ b/src/function/arithmetic/sqrt.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' const name = 'sqrt' const dependencies = ['config', 'typed', 'Complex'] @@ -29,7 +29,7 @@ export const createSqrt = /* #__PURE__ */ factory(name, dependencies, ({ config, * @return {number | BigNumber | Complex | Array | Matrix | Unit} * Returns the square root of `x` */ - const sqrt = typed('sqrt', { + return typed('sqrt', { number: _sqrtNumber, Complex: function (x) { @@ -47,7 +47,7 @@ export const createSqrt = /* #__PURE__ */ factory(name, dependencies, ({ config, 'Array | Matrix': function (x) { // deep map collection, skip zeros since sqrt(0) = 0 - return deepMap(x, sqrt, true) + return deepMap(x, this, true) }, Unit: function (x) { @@ -72,6 +72,4 @@ export const createSqrt = /* #__PURE__ */ factory(name, dependencies, ({ config, return new Complex(x, 0).sqrt() } } - - return sqrt }) diff --git a/src/function/arithmetic/square.js b/src/function/arithmetic/square.js index 8d601e7ae4..c9e9adde8e 100644 --- a/src/function/arithmetic/square.js +++ b/src/function/arithmetic/square.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { squareNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { squareNumber } from '../../plain/number/index.js' const name = 'square' const dependencies = ['typed'] @@ -32,7 +32,7 @@ export const createSquare = /* #__PURE__ */ factory(name, dependencies, ({ typed * @return {number | BigNumber | Fraction | Complex | Array | Matrix | Unit} * Squared value */ - const square = typed(name, { + return typed(name, { number: squareNumber, Complex: function (x) { @@ -49,13 +49,11 @@ export const createSquare = /* #__PURE__ */ factory(name, dependencies, ({ typed 'Array | Matrix': function (x) { // deep map collection, skip zeros since square(0) = 0 - return deepMap(x, square, true) + return deepMap(x, this, true) }, Unit: function (x) { return x.pow(2) } }) - - return square }) diff --git a/src/function/arithmetic/subtract.js b/src/function/arithmetic/subtract.js index b63bd8d5e7..abbb2f9204 100644 --- a/src/function/arithmetic/subtract.js +++ b/src/function/arithmetic/subtract.js @@ -1,11 +1,11 @@ -import { factory } from '../../utils/factory' -import { DimensionError } from '../../error/DimensionError' -import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01' -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm05 } from '../../type/matrix/utils/algorithm05' -import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' +import { factory } from '../../utils/factory.js' +import { DimensionError } from '../../error/DimensionError.js' +import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01.js' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm05 } from '../../type/matrix/utils/algorithm05.js' +import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' const name = 'subtract' const dependencies = [ @@ -60,7 +60,7 @@ export const createSubtract = /* #__PURE__ */ factory(name, dependencies, ({ typ * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} * Subtraction of `x` and `y` */ - const subtract = typed(name, { + return typed(name, { 'number, number': function (x, y) { return x - y @@ -92,7 +92,7 @@ export const createSubtract = /* #__PURE__ */ factory(name, dependencies, ({ typ } const res = x.clone() - res.value = subtract(res.value, y.value) + res.value = this(res.value, y.value) res.fixPrefix = false return res @@ -100,37 +100,37 @@ export const createSubtract = /* #__PURE__ */ factory(name, dependencies, ({ typ 'SparseMatrix, SparseMatrix': function (x, y) { checkEqualDimensions(x, y) - return algorithm05(x, y, subtract) + return algorithm05(x, y, this) }, 'SparseMatrix, DenseMatrix': function (x, y) { checkEqualDimensions(x, y) - return algorithm03(y, x, subtract, true) + return algorithm03(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { checkEqualDimensions(x, y) - return algorithm01(x, y, subtract, false) + return algorithm01(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { checkEqualDimensions(x, y) - return algorithm13(x, y, subtract) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return subtract(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return subtract(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return subtract(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { @@ -138,29 +138,27 @@ export const createSubtract = /* #__PURE__ */ factory(name, dependencies, ({ typ }, 'DenseMatrix, any': function (x, y) { - return algorithm14(x, y, subtract) + return algorithm14(x, y, this) }, 'any, SparseMatrix': function (x, y) { - return algorithm10(y, x, subtract, true) + return algorithm10(y, x, this, true) }, 'any, DenseMatrix': function (x, y) { - return algorithm14(y, x, subtract, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, subtract, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, subtract, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return subtract }) /** diff --git a/src/function/arithmetic/unaryMinus.js b/src/function/arithmetic/unaryMinus.js index 6554028e48..73f6a7ea88 100644 --- a/src/function/arithmetic/unaryMinus.js +++ b/src/function/arithmetic/unaryMinus.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { unaryMinusNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { unaryMinusNumber } from '../../plain/number/index.js' const name = 'unaryMinus' const dependencies = ['typed'] @@ -29,7 +29,7 @@ export const createUnaryMinus = /* #__PURE__ */ factory(name, dependencies, ({ t * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Number to be inverted. * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Returns the value with inverted sign. */ - const unaryMinus = typed(name, { + return typed(name, { number: unaryMinusNumber, Complex: function (x) { @@ -46,17 +46,15 @@ export const createUnaryMinus = /* #__PURE__ */ factory(name, dependencies, ({ t Unit: function (x) { const res = x.clone() - res.value = unaryMinus(x.value) + res.value = this(x.value) return res }, 'Array | Matrix': function (x) { // deep map collection, skip zeros since unaryMinus(0) = 0 - return deepMap(x, unaryMinus, true) + return deepMap(x, this, true) } // TODO: add support for string }) - - return unaryMinus }) diff --git a/src/function/arithmetic/unaryPlus.js b/src/function/arithmetic/unaryPlus.js index b83809b971..bcaccd1941 100644 --- a/src/function/arithmetic/unaryPlus.js +++ b/src/function/arithmetic/unaryPlus.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { unaryPlusNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { unaryPlusNumber } from '../../plain/number/index.js' const name = 'unaryPlus' const dependencies = ['typed', 'config', 'BigNumber'] @@ -30,7 +30,7 @@ export const createUnaryPlus = /* #__PURE__ */ factory(name, dependencies, ({ ty * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} * Returns the input value when numeric, converts to a number when input is non-numeric. */ - const unaryPlus = typed(name, { + return typed(name, { number: unaryPlusNumber, Complex: function (x) { @@ -51,7 +51,7 @@ export const createUnaryPlus = /* #__PURE__ */ factory(name, dependencies, ({ ty 'Array | Matrix': function (x) { // deep map collection, skip zeros since unaryPlus(0) = 0 - return deepMap(x, unaryPlus, true) + return deepMap(x, this, true) }, 'boolean | string': function (x) { @@ -59,6 +59,4 @@ export const createUnaryPlus = /* #__PURE__ */ factory(name, dependencies, ({ ty return (config.number === 'BigNumber') ? new BigNumber(+x) : +x } }) - - return unaryPlus }) diff --git a/src/function/arithmetic/xgcd.js b/src/function/arithmetic/xgcd.js index ec885a8b1a..556798af59 100644 --- a/src/function/arithmetic/xgcd.js +++ b/src/function/arithmetic/xgcd.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { xgcdNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { xgcdNumber } from '../../plain/number/index.js' const name = 'xgcd' const dependencies = ['typed', 'config', 'matrix', 'BigNumber'] diff --git a/src/function/bitwise/bitAnd.js b/src/function/bitwise/bitAnd.js index c67af5bf6f..aaaf8524fd 100644 --- a/src/function/bitwise/bitAnd.js +++ b/src/function/bitwise/bitAnd.js @@ -1,11 +1,11 @@ -import { bitAndBigNumber } from '../../utils/bignumber/bitwise' -import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { createAlgorithm06 } from '../../type/matrix/utils/algorithm06' -import { factory } from '../../utils/factory' -import { bitAndNumber } from '../../plain/number' +import { bitAndBigNumber } from '../../utils/bignumber/bitwise.js' +import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { createAlgorithm06 } from '../../type/matrix/utils/algorithm06.js' +import { factory } from '../../utils/factory.js' +import { bitAndNumber } from '../../plain/number/index.js' const name = 'bitAnd' const dependencies = [ @@ -43,69 +43,67 @@ export const createBitAnd = /* #__PURE__ */ factory(name, dependencies, ({ typed * @param {number | BigNumber | Array | Matrix} y Second value to and * @return {number | BigNumber | Array | Matrix} AND of `x` and `y` */ - const bitAnd = typed(name, { + return typed(name, { 'number, number': bitAndNumber, 'BigNumber, BigNumber': bitAndBigNumber, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm06(x, y, bitAnd, false) + return algorithm06(x, y, this, false) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm02(y, x, bitAnd, true) + return algorithm02(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm02(x, y, bitAnd, false) + return algorithm02(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, bitAnd) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return bitAnd(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return bitAnd(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return bitAnd(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { - return algorithm11(x, y, bitAnd, false) + return algorithm11(x, y, this, false) }, 'DenseMatrix, any': function (x, y) { - return algorithm14(x, y, bitAnd, false) + return algorithm14(x, y, this, false) }, 'any, SparseMatrix': function (x, y) { - return algorithm11(y, x, bitAnd, true) + return algorithm11(y, x, this, true) }, 'any, DenseMatrix': function (x, y) { - return algorithm14(y, x, bitAnd, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, bitAnd, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, bitAnd, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return bitAnd }) diff --git a/src/function/bitwise/bitNot.js b/src/function/bitwise/bitNot.js index e7d55da7f1..db532974a4 100644 --- a/src/function/bitwise/bitNot.js +++ b/src/function/bitwise/bitNot.js @@ -1,7 +1,7 @@ -import { bitNotBigNumber } from '../../utils/bignumber/bitwise' -import { deepMap } from '../../utils/collection' -import { factory } from '../../utils/factory' -import { bitNotNumber } from '../../plain/number' +import { bitNotBigNumber } from '../../utils/bignumber/bitwise.js' +import { deepMap } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' +import { bitNotNumber } from '../../plain/number/index.js' const name = 'bitNot' const dependencies = ['typed'] @@ -29,15 +29,13 @@ export const createBitNot = /* #__PURE__ */ factory(name, dependencies, ({ typed * @param {number | BigNumber | Array | Matrix} x Value to not * @return {number | BigNumber | Array | Matrix} NOT of `x` */ - const bitNot = typed(name, { + return typed(name, { number: bitNotNumber, BigNumber: bitNotBigNumber, 'Array | Matrix': function (x) { - return deepMap(x, bitNot) + return deepMap(x, this) } }) - - return bitNot }) diff --git a/src/function/bitwise/bitOr.js b/src/function/bitwise/bitOr.js index 8c1387afa3..908450ce8f 100644 --- a/src/function/bitwise/bitOr.js +++ b/src/function/bitwise/bitOr.js @@ -1,11 +1,11 @@ -import { bitOrBigNumber } from '../../utils/bignumber/bitwise' -import { factory } from '../../utils/factory' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10' -import { createAlgorithm04 } from '../../type/matrix/utils/algorithm04' -import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01' -import { bitOrNumber } from '../../plain/number' +import { bitOrBigNumber } from '../../utils/bignumber/bitwise.js' +import { factory } from '../../utils/factory.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10.js' +import { createAlgorithm04 } from '../../type/matrix/utils/algorithm04.js' +import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01.js' +import { bitOrNumber } from '../../plain/number/index.js' const name = 'bitOr' const dependencies = [ @@ -45,69 +45,67 @@ export const createBitOr = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | BigNumber | Array | Matrix} y Second value to or * @return {number | BigNumber | Array | Matrix} OR of `x` and `y` */ - const bitOr = typed(name, { + return typed(name, { 'number, number': bitOrNumber, 'BigNumber, BigNumber': bitOrBigNumber, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm04(x, y, bitOr) + return algorithm04(x, y, this) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm01(y, x, bitOr, true) + return algorithm01(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm01(x, y, bitOr, false) + return algorithm01(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, bitOr) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return bitOr(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return bitOr(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return bitOr(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { - return algorithm10(x, y, bitOr, false) + return algorithm10(x, y, this, false) }, 'DenseMatrix, any': function (x, y) { - return algorithm14(x, y, bitOr, false) + return algorithm14(x, y, this, false) }, 'any, SparseMatrix': function (x, y) { - return algorithm10(y, x, bitOr, true) + return algorithm10(y, x, this, true) }, 'any, DenseMatrix': function (x, y) { - return algorithm14(y, x, bitOr, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, bitOr, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, bitOr, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return bitOr }) diff --git a/src/function/bitwise/bitXor.js b/src/function/bitwise/bitXor.js index 26991fa614..b2edac3139 100644 --- a/src/function/bitwise/bitXor.js +++ b/src/function/bitwise/bitXor.js @@ -1,11 +1,11 @@ -import { bitXor as bigBitXor } from '../../utils/bignumber/bitwise' -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { factory } from '../../utils/factory' -import { bitXorNumber } from '../../plain/number' +import { bitXor as bigBitXor } from '../../utils/bignumber/bitwise.js' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { factory } from '../../utils/factory.js' +import { bitXorNumber } from '../../plain/number/index.js' const name = 'bitXor' const dependencies = [ @@ -43,69 +43,67 @@ export const createBitXor = /* #__PURE__ */ factory(name, dependencies, ({ typed * @param {number | BigNumber | Array | Matrix} y Second value to xor * @return {number | BigNumber | Array | Matrix} XOR of `x` and `y` */ - const bitXor = typed(name, { + return typed(name, { 'number, number': bitXorNumber, 'BigNumber, BigNumber': bigBitXor, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm07(x, y, bitXor) + return algorithm07(x, y, this) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm03(y, x, bitXor, true) + return algorithm03(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm03(x, y, bitXor, false) + return algorithm03(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, bitXor) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return bitXor(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return bitXor(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return bitXor(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { - return algorithm12(x, y, bitXor, false) + return algorithm12(x, y, this, false) }, 'DenseMatrix, any': function (x, y) { - return algorithm14(x, y, bitXor, false) + return algorithm14(x, y, this, false) }, 'any, SparseMatrix': function (x, y) { - return algorithm12(y, x, bitXor, true) + return algorithm12(y, x, this, true) }, 'any, DenseMatrix': function (x, y) { - return algorithm14(y, x, bitXor, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, bitXor, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, bitXor, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return bitXor }) diff --git a/src/function/bitwise/index.js b/src/function/bitwise/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/bitwise/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/bitwise/leftShift.js b/src/function/bitwise/leftShift.js index dd504a17d4..0e72039bf4 100644 --- a/src/function/bitwise/leftShift.js +++ b/src/function/bitwise/leftShift.js @@ -1,13 +1,13 @@ -import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01' -import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10' -import { createAlgorithm08 } from '../../type/matrix/utils/algorithm08' -import { factory } from '../../utils/factory' -import { leftShiftNumber } from '../../plain/number' -import { leftShiftBigNumber } from '../../utils/bignumber/bitwise' +import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01.js' +import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10.js' +import { createAlgorithm08 } from '../../type/matrix/utils/algorithm08.js' +import { factory } from '../../utils/factory.js' +import { leftShiftNumber } from '../../plain/number/index.js' +import { leftShiftBigNumber } from '../../utils/bignumber/bitwise.js' const name = 'leftShift' const dependencies = [ @@ -50,41 +50,41 @@ export const createLeftShift = /* #__PURE__ */ factory(name, dependencies, ({ ty * @param {number | BigNumber} y Amount of shifts * @return {number | BigNumber | Array | Matrix} `x` shifted left `y` times */ - const leftShift = typed(name, { + return typed(name, { 'number, number': leftShiftNumber, 'BigNumber, BigNumber': leftShiftBigNumber, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm08(x, y, leftShift, false) + return algorithm08(x, y, this, false) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm02(y, x, leftShift, true) + return algorithm02(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm01(x, y, leftShift, false) + return algorithm01(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, leftShift) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return leftShift(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return leftShift(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return leftShift(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, number | BigNumber': function (x, y) { @@ -92,7 +92,7 @@ export const createLeftShift = /* #__PURE__ */ factory(name, dependencies, ({ ty if (equalScalar(y, 0)) { return x.clone() } - return algorithm11(x, y, leftShift, false) + return algorithm11(x, y, this, false) }, 'DenseMatrix, number | BigNumber': function (x, y) { @@ -100,7 +100,7 @@ export const createLeftShift = /* #__PURE__ */ factory(name, dependencies, ({ ty if (equalScalar(y, 0)) { return x.clone() } - return algorithm14(x, y, leftShift, false) + return algorithm14(x, y, this, false) }, 'number | BigNumber, SparseMatrix': function (x, y) { @@ -108,7 +108,7 @@ export const createLeftShift = /* #__PURE__ */ factory(name, dependencies, ({ ty if (equalScalar(x, 0)) { return zeros(y.size(), y.storage()) } - return algorithm10(y, x, leftShift, true) + return algorithm10(y, x, this, true) }, 'number | BigNumber, DenseMatrix': function (x, y) { @@ -116,19 +116,17 @@ export const createLeftShift = /* #__PURE__ */ factory(name, dependencies, ({ ty if (equalScalar(x, 0)) { return zeros(y.size(), y.storage()) } - return algorithm14(y, x, leftShift, true) + return algorithm14(y, x, this, true) }, 'Array, number | BigNumber': function (x, y) { // use matrix implementation - return leftShift(matrix(x), y).valueOf() + return this(matrix(x), y).valueOf() }, 'number | BigNumber, Array': function (x, y) { // use matrix implementation - return leftShift(x, matrix(y)).valueOf() + return this(x, matrix(y)).valueOf() } }) - - return leftShift }) diff --git a/src/function/bitwise/rightArithShift.js b/src/function/bitwise/rightArithShift.js index 703536e16d..16c806f44a 100644 --- a/src/function/bitwise/rightArithShift.js +++ b/src/function/bitwise/rightArithShift.js @@ -1,13 +1,13 @@ -import { rightArithShiftBigNumber } from '../../utils/bignumber/bitwise' -import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01' -import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10' -import { createAlgorithm08 } from '../../type/matrix/utils/algorithm08' -import { factory } from '../../utils/factory' -import { rightArithShiftNumber } from '../../plain/number' +import { rightArithShiftBigNumber } from '../../utils/bignumber/bitwise.js' +import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01.js' +import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10.js' +import { createAlgorithm08 } from '../../type/matrix/utils/algorithm08.js' +import { factory } from '../../utils/factory.js' +import { rightArithShiftNumber } from '../../plain/number/index.js' const name = 'rightArithShift' const dependencies = [ @@ -50,41 +50,41 @@ export const createRightArithShift = /* #__PURE__ */ factory(name, dependencies, * @param {number | BigNumber} y Amount of shifts * @return {number | BigNumber | Array | Matrix} `x` sign-filled shifted right `y` times */ - const rightArithShift = typed(name, { + return typed(name, { 'number, number': rightArithShiftNumber, 'BigNumber, BigNumber': rightArithShiftBigNumber, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm08(x, y, rightArithShift, false) + return algorithm08(x, y, this, false) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm02(y, x, rightArithShift, true) + return algorithm02(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm01(x, y, rightArithShift, false) + return algorithm01(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, rightArithShift) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return rightArithShift(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return rightArithShift(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return rightArithShift(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, number | BigNumber': function (x, y) { @@ -92,7 +92,7 @@ export const createRightArithShift = /* #__PURE__ */ factory(name, dependencies, if (equalScalar(y, 0)) { return x.clone() } - return algorithm11(x, y, rightArithShift, false) + return algorithm11(x, y, this, false) }, 'DenseMatrix, number | BigNumber': function (x, y) { @@ -100,7 +100,7 @@ export const createRightArithShift = /* #__PURE__ */ factory(name, dependencies, if (equalScalar(y, 0)) { return x.clone() } - return algorithm14(x, y, rightArithShift, false) + return algorithm14(x, y, this, false) }, 'number | BigNumber, SparseMatrix': function (x, y) { @@ -108,7 +108,7 @@ export const createRightArithShift = /* #__PURE__ */ factory(name, dependencies, if (equalScalar(x, 0)) { return zeros(y.size(), y.storage()) } - return algorithm10(y, x, rightArithShift, true) + return algorithm10(y, x, this, true) }, 'number | BigNumber, DenseMatrix': function (x, y) { @@ -116,19 +116,17 @@ export const createRightArithShift = /* #__PURE__ */ factory(name, dependencies, if (equalScalar(x, 0)) { return zeros(y.size(), y.storage()) } - return algorithm14(y, x, rightArithShift, true) + return algorithm14(y, x, this, true) }, 'Array, number | BigNumber': function (x, y) { // use matrix implementation - return rightArithShift(matrix(x), y).valueOf() + return this(matrix(x), y).valueOf() }, 'number | BigNumber, Array': function (x, y) { // use matrix implementation - return rightArithShift(x, matrix(y)).valueOf() + return this(x, matrix(y)).valueOf() } }) - - return rightArithShift }) diff --git a/src/function/bitwise/rightLogShift.js b/src/function/bitwise/rightLogShift.js index 748ca5642c..7354f1bab8 100644 --- a/src/function/bitwise/rightLogShift.js +++ b/src/function/bitwise/rightLogShift.js @@ -1,12 +1,12 @@ -import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01' -import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10' -import { createAlgorithm08 } from '../../type/matrix/utils/algorithm08' -import { factory } from '../../utils/factory' -import { rightLogShiftNumber } from '../../plain/number' +import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01.js' +import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10.js' +import { createAlgorithm08 } from '../../type/matrix/utils/algorithm08.js' +import { factory } from '../../utils/factory.js' +import { rightLogShiftNumber } from '../../plain/number/index.js' const name = 'rightLogShift' const dependencies = [ @@ -50,41 +50,41 @@ export const createRightLogShift = /* #__PURE__ */ factory(name, dependencies, ( * @return {number | Array | Matrix} `x` zero-filled shifted right `y` times */ - const rightLogShift = typed(name, { + return typed(name, { 'number, number': rightLogShiftNumber, // 'BigNumber, BigNumber': ..., // TODO: implement BigNumber support for rightLogShift 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm08(x, y, rightLogShift, false) + return algorithm08(x, y, this, false) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm02(y, x, rightLogShift, true) + return algorithm02(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm01(x, y, rightLogShift, false) + return algorithm01(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, rightLogShift) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return rightLogShift(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return rightLogShift(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return rightLogShift(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, number | BigNumber': function (x, y) { @@ -92,7 +92,7 @@ export const createRightLogShift = /* #__PURE__ */ factory(name, dependencies, ( if (equalScalar(y, 0)) { return x.clone() } - return algorithm11(x, y, rightLogShift, false) + return algorithm11(x, y, this, false) }, 'DenseMatrix, number | BigNumber': function (x, y) { @@ -100,7 +100,7 @@ export const createRightLogShift = /* #__PURE__ */ factory(name, dependencies, ( if (equalScalar(y, 0)) { return x.clone() } - return algorithm14(x, y, rightLogShift, false) + return algorithm14(x, y, this, false) }, 'number | BigNumber, SparseMatrix': function (x, y) { @@ -108,7 +108,7 @@ export const createRightLogShift = /* #__PURE__ */ factory(name, dependencies, ( if (equalScalar(x, 0)) { return zeros(y.size(), y.storage()) } - return algorithm10(y, x, rightLogShift, true) + return algorithm10(y, x, this, true) }, 'number | BigNumber, DenseMatrix': function (x, y) { @@ -116,19 +116,17 @@ export const createRightLogShift = /* #__PURE__ */ factory(name, dependencies, ( if (equalScalar(x, 0)) { return zeros(y.size(), y.storage()) } - return algorithm14(y, x, rightLogShift, true) + return algorithm14(y, x, this, true) }, 'Array, number | BigNumber': function (x, y) { // use matrix implementation - return rightLogShift(matrix(x), y).valueOf() + return this(matrix(x), y).valueOf() }, 'number | BigNumber, Array': function (x, y) { // use matrix implementation - return rightLogShift(x, matrix(y)).valueOf() + return this(x, matrix(y)).valueOf() } }) - - return rightLogShift }) diff --git a/src/function/combinatorics/bellNumbers.js b/src/function/combinatorics/bellNumbers.js index 59573c5b8b..fcc9472868 100644 --- a/src/function/combinatorics/bellNumbers.js +++ b/src/function/combinatorics/bellNumbers.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'bellNumbers' const dependencies = ['typed', 'addScalar', 'isNegative', 'isInteger', 'stirlingS2'] diff --git a/src/function/combinatorics/catalan.js b/src/function/combinatorics/catalan.js index 9837c8dce3..dbe6ce76ff 100644 --- a/src/function/combinatorics/catalan.js +++ b/src/function/combinatorics/catalan.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'catalan' const dependencies = [ diff --git a/src/function/combinatorics/composition.js b/src/function/combinatorics/composition.js index 96d3ff695e..9a937b1e93 100644 --- a/src/function/combinatorics/composition.js +++ b/src/function/combinatorics/composition.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'composition' const dependencies = [ diff --git a/src/function/combinatorics/index.js b/src/function/combinatorics/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/combinatorics/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/combinatorics/stirlingS2.js b/src/function/combinatorics/stirlingS2.js index b43b2c8481..89bd9c8a1c 100644 --- a/src/function/combinatorics/stirlingS2.js +++ b/src/function/combinatorics/stirlingS2.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'stirlingS2' const dependencies = [ diff --git a/src/function/complex/arg.js b/src/function/complex/arg.js index b4efff281a..67b4c278ef 100644 --- a/src/function/complex/arg.js +++ b/src/function/complex/arg.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' const name = 'arg' const dependencies = ['typed'] @@ -32,7 +32,7 @@ export const createArg = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * A complex number or array with complex numbers * @return {number | BigNumber | Array | Matrix} The argument of x */ - const arg = typed(name, { + return typed(name, { number: function (x) { return Math.atan2(0, x) }, @@ -48,9 +48,7 @@ export const createArg = /* #__PURE__ */ factory(name, dependencies, ({ typed }) // TODO: implement BigNumber support for function arg 'Array | Matrix': function (x) { - return deepMap(x, arg) + return deepMap(x, this) } }) - - return arg }) diff --git a/src/function/complex/conj.js b/src/function/complex/conj.js index 99dade2763..b94ece8bf7 100644 --- a/src/function/complex/conj.js +++ b/src/function/complex/conj.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' const name = 'conj' const dependencies = ['typed'] @@ -30,7 +30,7 @@ export const createConj = /* #__PURE__ */ factory(name, dependencies, ({ typed } * @return {number | BigNumber | Complex | Array | Matrix} * The complex conjugate of x */ - const conj = typed(name, { + return typed(name, { number: function (x) { return x }, @@ -44,9 +44,7 @@ export const createConj = /* #__PURE__ */ factory(name, dependencies, ({ typed } }, 'Array | Matrix': function (x) { - return deepMap(x, conj) + return deepMap(x, this) } }) - - return conj }) diff --git a/src/function/complex/im.js b/src/function/complex/im.js index 04d3845a73..d51fa29b77 100644 --- a/src/function/complex/im.js +++ b/src/function/complex/im.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' const name = 'im' const dependencies = ['typed'] @@ -32,7 +32,7 @@ export const createIm = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * A complex number or array with complex numbers * @return {number | BigNumber | Array | Matrix} The imaginary part of x */ - const im = typed(name, { + return typed(name, { number: function (x) { return 0 }, @@ -46,9 +46,7 @@ export const createIm = /* #__PURE__ */ factory(name, dependencies, ({ typed }) }, 'Array | Matrix': function (x) { - return deepMap(x, im) + return deepMap(x, this) } }) - - return im }) diff --git a/src/function/complex/index.js b/src/function/complex/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/complex/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/complex/re.js b/src/function/complex/re.js index 8b63fe7d75..a22d1a68a1 100644 --- a/src/function/complex/re.js +++ b/src/function/complex/re.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' const name = 're' const dependencies = ['typed'] @@ -32,7 +32,7 @@ export const createRe = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * A complex number or array with complex numbers * @return {number | BigNumber | Array | Matrix} The real part of x */ - const re = typed(name, { + return typed(name, { number: function (x) { return x }, @@ -46,9 +46,7 @@ export const createRe = /* #__PURE__ */ factory(name, dependencies, ({ typed }) }, 'Array | Matrix': function (x) { - return deepMap(x, re) + return deepMap(x, this) } }) - - return re }) diff --git a/src/function/geometry/distance.js b/src/function/geometry/distance.js index 3ecd295106..246cb2663a 100644 --- a/src/function/geometry/distance.js +++ b/src/function/geometry/distance.js @@ -1,5 +1,5 @@ -import { isBigNumber } from '../../utils/is' -import { factory } from '../../utils/factory' +import { isBigNumber } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' const name = 'distance' const dependencies = [ diff --git a/src/function/geometry/index.js b/src/function/geometry/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/geometry/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/geometry/intersect.js b/src/function/geometry/intersect.js index ebc3c2e695..3df58f591e 100644 --- a/src/function/geometry/intersect.js +++ b/src/function/geometry/intersect.js @@ -1,5 +1,5 @@ -import { isBigNumber } from '../../utils/is' -import { factory } from '../../utils/factory' +import { isBigNumber } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' const name = 'intersect' const dependencies = [ @@ -34,7 +34,7 @@ export const createIntersect = /* #__PURE__ */ factory(name, dependencies, ({ ty * OR null if the calculation is for line and plane * @return {Array} Returns the point of intersection of lines/lines-planes */ - const intersect = typed('intersect', { + return typed('intersect', { 'Array, Array, Array': function (x, y, plane) { if (!_3d(x)) { throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument') } if (!_3d(y)) { throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument') } @@ -64,12 +64,12 @@ export const createIntersect = /* #__PURE__ */ factory(name, dependencies, ({ ty }, 'Matrix, Matrix, Matrix': function (x, y, plane) { - return matrix(intersect(x.valueOf(), y.valueOf(), plane.valueOf())) + return matrix(this(x.valueOf(), y.valueOf(), plane.valueOf())) }, 'Matrix, Matrix, Matrix, Matrix': function (w, x, y, z) { // TODO: output matrix type should match input matrix type - return matrix(intersect(w.valueOf(), x.valueOf(), y.valueOf(), z.valueOf())) + return matrix(this(w.valueOf(), x.valueOf(), y.valueOf(), z.valueOf())) } }) @@ -157,6 +157,4 @@ export const createIntersect = /* #__PURE__ */ factory(name, dependencies, ({ ty // (a) no intersection, // (b) line contained in plane } - - return intersect }) diff --git a/src/function/index.js b/src/function/index.js deleted file mode 100644 index 54ef2a865b..0000000000 --- a/src/function/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/logical/and.js b/src/function/logical/and.js index 433c67a0bc..a20523f34b 100644 --- a/src/function/logical/and.js +++ b/src/function/logical/and.js @@ -1,10 +1,10 @@ -import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { createAlgorithm06 } from '../../type/matrix/utils/algorithm06' -import { factory } from '../../utils/factory' -import { andNumber } from '../../plain/number' +import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { createAlgorithm06 } from '../../type/matrix/utils/algorithm06.js' +import { factory } from '../../utils/factory.js' +import { andNumber } from '../../plain/number/index.js' const name = 'and' const dependencies = [ @@ -50,7 +50,7 @@ export const createAnd = /* #__PURE__ */ factory(name, dependencies, ({ typed, m * @return {boolean | Array | Matrix} * Returns true when both inputs are defined with a nonzero/nonempty value. */ - const and = typed(name, { + return typed(name, { 'number, number': andNumber, @@ -63,38 +63,38 @@ export const createAnd = /* #__PURE__ */ factory(name, dependencies, ({ typed, m }, 'Unit, Unit': function (x, y) { - return and(x.value || 0, y.value || 0) + return this(x.value || 0, y.value || 0) }, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm06(x, y, and, false) + return algorithm06(x, y, this, false) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm02(y, x, and, true) + return algorithm02(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm02(x, y, and, false) + return algorithm02(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, and) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return and(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return and(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return and(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { @@ -103,7 +103,7 @@ export const createAnd = /* #__PURE__ */ factory(name, dependencies, ({ typed, m // return zero matrix return zeros(x.size(), x.storage()) } - return algorithm11(x, y, and, false) + return algorithm11(x, y, this, false) }, 'DenseMatrix, any': function (x, y) { @@ -112,7 +112,7 @@ export const createAnd = /* #__PURE__ */ factory(name, dependencies, ({ typed, m // return zero matrix return zeros(x.size(), x.storage()) } - return algorithm14(x, y, and, false) + return algorithm14(x, y, this, false) }, 'any, SparseMatrix': function (x, y) { @@ -121,7 +121,7 @@ export const createAnd = /* #__PURE__ */ factory(name, dependencies, ({ typed, m // return zero matrix return zeros(x.size(), x.storage()) } - return algorithm11(y, x, and, true) + return algorithm11(y, x, this, true) }, 'any, DenseMatrix': function (x, y) { @@ -130,19 +130,17 @@ export const createAnd = /* #__PURE__ */ factory(name, dependencies, ({ typed, m // return zero matrix return zeros(x.size(), x.storage()) } - return algorithm14(y, x, and, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return and(matrix(x), y).valueOf() + return this(matrix(x), y).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return and(x, matrix(y)).valueOf() + return this(x, matrix(y)).valueOf() } }) - - return and }) diff --git a/src/function/logical/index.js b/src/function/logical/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/logical/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/logical/not.js b/src/function/logical/not.js index 9d2e44d517..aa38beaee7 100644 --- a/src/function/logical/not.js +++ b/src/function/logical/not.js @@ -1,6 +1,6 @@ -import { deepMap } from '../../utils/collection' -import { factory } from '../../utils/factory' -import { notNumber } from '../../plain/number' +import { deepMap } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' +import { notNumber } from '../../plain/number/index.js' const name = 'not' const dependencies = ['typed'] @@ -31,7 +31,7 @@ export const createNot = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @return {boolean | Array | Matrix} * Returns true when input is a zero or empty value. */ - const not = typed(name, { + return typed(name, { number: notNumber, Complex: function (x) { @@ -43,13 +43,11 @@ export const createNot = /* #__PURE__ */ factory(name, dependencies, ({ typed }) }, Unit: function (x) { - return x.value !== null ? not(x.value) : true + return x.value !== null ? this(x.value) : true }, 'Array | Matrix': function (x) { - return deepMap(x, not) + return deepMap(x, this) } }) - - return not }) diff --git a/src/function/logical/or.js b/src/function/logical/or.js index 57cac71b99..d7539055f0 100644 --- a/src/function/logical/or.js +++ b/src/function/logical/or.js @@ -1,10 +1,10 @@ -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { createAlgorithm05 } from '../../type/matrix/utils/algorithm05' -import { factory } from '../../utils/factory' -import { orNumber } from '../../plain/number' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { createAlgorithm05 } from '../../type/matrix/utils/algorithm05.js' +import { factory } from '../../utils/factory.js' +import { orNumber } from '../../plain/number/index.js' const name = 'or' const dependencies = [ @@ -49,7 +49,7 @@ export const createOr = /* #__PURE__ */ factory(name, dependencies, ({ typed, ma * @return {boolean | Array | Matrix} * Returns true when one of the inputs is defined with a nonzero/nonempty value. */ - const or = typed(name, { + return typed(name, { 'number, number': orNumber, @@ -62,66 +62,64 @@ export const createOr = /* #__PURE__ */ factory(name, dependencies, ({ typed, ma }, 'Unit, Unit': function (x, y) { - return or(x.value || 0, y.value || 0) + return this(x.value || 0, y.value || 0) }, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm05(x, y, or) + return algorithm05(x, y, this) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm03(y, x, or, true) + return algorithm03(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm03(x, y, or, false) + return algorithm03(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, or) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return or(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return or(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return or(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { - return algorithm12(x, y, or, false) + return algorithm12(x, y, this, false) }, 'DenseMatrix, any': function (x, y) { - return algorithm14(x, y, or, false) + return algorithm14(x, y, this, false) }, 'any, SparseMatrix': function (x, y) { - return algorithm12(y, x, or, true) + return algorithm12(y, x, this, true) }, 'any, DenseMatrix': function (x, y) { - return algorithm14(y, x, or, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, or, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, or, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return or }) diff --git a/src/function/logical/xor.js b/src/function/logical/xor.js index 129a318700..6ee5ab05c5 100644 --- a/src/function/logical/xor.js +++ b/src/function/logical/xor.js @@ -1,10 +1,10 @@ -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { factory } from '../../utils/factory' -import { xorNumber } from '../../plain/number' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { factory } from '../../utils/factory.js' +import { xorNumber } from '../../plain/number/index.js' const name = 'xor' const dependencies = [ @@ -48,7 +48,7 @@ export const createXor = /* #__PURE__ */ factory(name, dependencies, ({ typed, m * @return {boolean | Array | Matrix} * Returns true when one and only one input is defined with a nonzero/nonempty value. */ - const xor = typed(name, { + return typed(name, { 'number, number': xorNumber, @@ -61,66 +61,64 @@ export const createXor = /* #__PURE__ */ factory(name, dependencies, ({ typed, m }, 'Unit, Unit': function (x, y) { - return xor(x.value || 0, y.value || 0) + return this(x.value || 0, y.value || 0) }, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm07(x, y, xor) + return algorithm07(x, y, this) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm03(y, x, xor, true) + return algorithm03(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm03(x, y, xor, false) + return algorithm03(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, xor) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return xor(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return xor(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return xor(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { - return algorithm12(x, y, xor, false) + return algorithm12(x, y, this, false) }, 'DenseMatrix, any': function (x, y) { - return algorithm14(x, y, xor, false) + return algorithm14(x, y, this, false) }, 'any, SparseMatrix': function (x, y) { - return algorithm12(y, x, xor, true) + return algorithm12(y, x, this, true) }, 'any, DenseMatrix': function (x, y) { - return algorithm14(y, x, xor, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, xor, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, xor, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return xor }) diff --git a/src/function/matrix/apply.js b/src/function/matrix/apply.js index 4593b9a88c..d675779fc3 100644 --- a/src/function/matrix/apply.js +++ b/src/function/matrix/apply.js @@ -1,7 +1,7 @@ -import { factory } from '../../utils/factory' -import { arraySize } from '../../utils/array' -import { isMatrix } from '../../utils/is' -import { IndexError } from '../../error/IndexError' +import { factory } from '../../utils/factory.js' +import { arraySize } from '../../utils/array.js' +import { isMatrix } from '../../utils/is.js' +import { IndexError } from '../../error/IndexError.js' const name = 'apply' const dependencies = ['typed', 'isInteger'] @@ -39,7 +39,7 @@ export const createApply = /* #__PURE__ */ factory(name, dependencies, ({ typed, * return a number. * @return {Array | Matrix} res The residual matrix with the function applied over some dimension. */ - const apply = typed(name, { + return typed(name, { 'Array | Matrix, number | BigNumber, function': function (mat, dim, callback) { if (!isInteger(dim)) { throw new TypeError('Integer number expected for dimension') @@ -57,8 +57,6 @@ export const createApply = /* #__PURE__ */ factory(name, dependencies, ({ typed, } } }) - - return apply }) /** diff --git a/src/function/matrix/column.js b/src/function/matrix/column.js index 969ea4eed6..bb4f219872 100644 --- a/src/function/matrix/column.js +++ b/src/function/matrix/column.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { clone } from '../../utils/object' -import { validateIndex } from '../../utils/array' +import { factory } from '../../utils/factory.js' +import { clone } from '../../utils/object.js' +import { validateIndex } from '../../utils/array.js' const name = 'column' const dependencies = ['typed', 'Index', 'matrix', 'range'] @@ -17,7 +17,7 @@ export const createColumn = /* #__PURE__ */ factory(name, dependencies, ({ typed * * // get a column * const d = [[1, 2], [3, 4]] - * math.column(d, 1) // returns [2, 4] + * math.column(d, 1) // returns [[2], [4]] * * See also: * @@ -27,7 +27,7 @@ export const createColumn = /* #__PURE__ */ factory(name, dependencies, ({ typed * @param {number} column The index of the column * @return {Array | Matrix} The retrieved column */ - const column = typed(name, { + return typed(name, { 'Matrix, number': _column, 'Array, number': function (value, column) { @@ -35,8 +35,6 @@ export const createColumn = /* #__PURE__ */ factory(name, dependencies, ({ typed } }) - return column - /** * Retrieve a column of a matrix * @param {Matrix } value A matrix diff --git a/src/function/matrix/concat.js b/src/function/matrix/concat.js index c170af3a8d..8db4bd6668 100644 --- a/src/function/matrix/concat.js +++ b/src/function/matrix/concat.js @@ -1,9 +1,9 @@ -import { isBigNumber, isMatrix, isNumber } from '../../utils/is' -import { clone } from '../../utils/object' -import { arraySize } from '../../utils/array' -import { IndexError } from '../../error/IndexError' -import { DimensionError } from '../../error/DimensionError' -import { factory } from '../../utils/factory' +import { isBigNumber, isMatrix, isNumber } from '../../utils/is.js' +import { clone } from '../../utils/object.js' +import { arraySize } from '../../utils/array.js' +import { IndexError } from '../../error/IndexError.js' +import { DimensionError } from '../../error/DimensionError.js' +import { factory } from '../../utils/factory.js' const name = 'concat' const dependencies = ['typed', 'matrix', 'isInteger'] diff --git a/src/function/matrix/cross.js b/src/function/matrix/cross.js index 69d4c00871..a943441720 100644 --- a/src/function/matrix/cross.js +++ b/src/function/matrix/cross.js @@ -1,5 +1,5 @@ -import { arraySize, squeeze } from '../../utils/array' -import { factory } from '../../utils/factory' +import { arraySize, squeeze } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'cross' const dependencies = ['typed', 'matrix', 'subtract', 'multiply'] diff --git a/src/function/matrix/ctranspose.js b/src/function/matrix/ctranspose.js index e800650085..a423ab2a5c 100644 --- a/src/function/matrix/ctranspose.js +++ b/src/function/matrix/ctranspose.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'ctranspose' const dependencies = ['typed', 'transpose', 'conj'] diff --git a/src/function/matrix/det.js b/src/function/matrix/det.js index 6b14afd9b8..5605205f64 100644 --- a/src/function/matrix/det.js +++ b/src/function/matrix/det.js @@ -1,7 +1,7 @@ -import { isMatrix } from '../../utils/is' -import { clone } from '../../utils/object' -import { format } from '../../utils/string' -import { factory } from '../../utils/factory' +import { isMatrix } from '../../utils/is.js' +import { clone } from '../../utils/object.js' +import { format } from '../../utils/string.js' +import { factory } from '../../utils/factory.js' const name = 'det' const dependencies = ['typed', 'matrix', 'subtract', 'multiply', 'unaryMinus', 'lup'] diff --git a/src/function/matrix/diag.js b/src/function/matrix/diag.js index 093c04c9db..a0f9bc4d47 100644 --- a/src/function/matrix/diag.js +++ b/src/function/matrix/diag.js @@ -1,7 +1,7 @@ -import { isMatrix } from '../../utils/is' -import { arraySize } from '../../utils/array' -import { isInteger } from '../../utils/number' -import { factory } from '../../utils/factory' +import { isMatrix } from '../../utils/is.js' +import { arraySize } from '../../utils/array.js' +import { isInteger } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' const name = 'diag' const dependencies = ['typed', 'matrix', 'DenseMatrix', 'SparseMatrix'] diff --git a/src/function/matrix/diff.js b/src/function/matrix/diff.js new file mode 100644 index 0000000000..40ce422188 --- /dev/null +++ b/src/function/matrix/diff.js @@ -0,0 +1,163 @@ +import { factory } from '../../utils/factory.js' +import { isInteger } from '../../utils/number.js' +import { isMatrix } from '../../utils/is.js' + +const name = 'diff' +const dependencies = ['typed', 'matrix', 'subtract', 'number'] + +export const createDiff = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, subtract, number }) => { + /** + * Create a new matrix or array of the difference between elements of the given array + * The optional dim parameter lets you specify the dimension to evaluate the difference of + * If no dimension parameter is passed it is assumed as dimension 0 + * + * Dimension is zero-based in javascript and one-based in the parser and can be a number or bignumber + * Arrays must be 'rectangular' meaning arrays like [1, 2] + * If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays + * + * Syntax: + * + * math.diff(arr) + * math.diff(arr, dim) + * + * Examples: + * + * const arr = [1, 2, 4, 7, 0] + * math.diff(arr) // returns [1, 2, 3, -7] (no dimension passed so 0 is assumed) + * math.diff(math.matrix(arr)) // returns math.matrix([1, 2, 3, -7]) + * + * const arr = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [9, 8, 7, 6, 4]] + * math.diff(arr) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]] + * math.diff(arr, 0) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]] + * math.diff(arr, 1) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]] + * math.diff(arr, math.bignumber(1)) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]] + * + * math.diff(arr, 2) // throws RangeError as arr is 2 dimensional not 3 + * math.diff(arr, -1) // throws RangeError as negative dimensions are not allowed + * + * // These will all produce the same result + * math.diff([[1, 2], [3, 4]]) + * math.diff([math.matrix([1, 2]), math.matrix([3, 4])]) + * math.diff([[1, 2], math.matrix([3, 4])]) + * math.diff([math.matrix([1, 2]), [3, 4]]) + * // They do not produce the same result as math.diff(math.matrix([[1, 2], [3, 4]])) as this returns a matrix + * + * See Also: + * + * sum + * subtract + * partitionSelect + * + * @param {Array | Matrix} arr An array or matrix + * @param {number} dim Dimension + * @return {Array | Matrix} Difference between array elements in given dimension + */ + return typed(name, { + 'Array | Matrix': function (arr) { // No dimension specified => assume dimension 0 + if (isMatrix(arr)) { + return matrix(_diff(arr.toArray())) + } else { + return _diff(arr) + } + }, + 'Array | Matrix, number': function (arr, dim) { + if (!isInteger(dim)) throw new RangeError('Dimension must be a whole number') + if (isMatrix(arr)) { + return matrix(_recursive(arr.toArray(), dim)) + } else { + return _recursive(arr, dim) + } + }, + 'Array | Matrix, BigNumber': function (arr, dim) { + return this(arr, number(dim)) + } + }) + + /** + * Recursively find the correct dimension in the array/matrix + * Then Apply _diff to that dimension + * + * @param {Array} arr The array + * @param {number} dim Dimension + * @return {Array} resulting array + */ + function _recursive (arr, dim) { + if (isMatrix(arr)) { + arr = arr.toArray() // Makes sure arrays like [ matrix([0, 1]), matrix([1, 0]) ] are processed properly + } + if (!Array.isArray(arr)) { + throw RangeError('Array/Matrix does not have that many dimensions') + } + if (dim > 0) { + const result = [] + arr.forEach(element => { + result.push(_recursive(element, dim - 1)) + }) + return result + } else if (dim === 0) { + return _diff(arr) + } else { + throw RangeError('Cannot have negative dimension') + } + } + + /** + * Difference between elements in the array + * + * @param {Array} arr An array + * @return {Array} resulting array + */ + function _diff (arr) { + const result = [] + const size = arr.length + if (size < 2) { + return arr + } + for (let i = 1; i < size; i++) { + result.push(_ElementDiff(arr[i - 1], arr[i])) + } + return result + } + + /** + * Difference between 2 objects + * + * @param {Object} obj1 First object + * @param {Object} obj2 Second object + * @return {Array} resulting array + */ + function _ElementDiff (obj1, obj2) { + // Convert matrices to arrays + if (isMatrix(obj1)) obj1 = obj1.toArray() + if (isMatrix(obj2)) obj2 = obj2.toArray() + + const obj1IsArray = Array.isArray(obj1) + const obj2IsArray = Array.isArray(obj2) + if (obj1IsArray && obj2IsArray) { + return _ArrayDiff(obj1, obj2) + } + if (!obj1IsArray && !obj2IsArray) { + return subtract(obj2, obj1) // Difference is (second - first) NOT (first - second) + } + throw TypeError('Cannot calculate difference between 1 array and 1 non-array') + } + + /** + * Difference of elements in 2 arrays + * + * @param {Array} arr1 Array 1 + * @param {Array} arr2 Array 2 + * @return {Array} resulting array + */ + function _ArrayDiff (arr1, arr2) { + if (arr1.length !== arr2.length) { + throw RangeError('Not all sub-arrays have the same length') + } + const result = [] + const size = arr1.length + for (let i = 0; i < size; i++) { + result.push(_ElementDiff(arr1[i], arr2[i])) + } + return result + } +}) diff --git a/src/function/matrix/dot.js b/src/function/matrix/dot.js index 7e7a7daf98..bf47bb8b76 100644 --- a/src/function/matrix/dot.js +++ b/src/function/matrix/dot.js @@ -1,15 +1,15 @@ -import { arraySize as size } from '../../utils/array' -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' +import { isMatrix } from '../../utils/is.js' const name = 'dot' -const dependencies = ['typed', 'add', 'multiply'] +const dependencies = ['typed', 'addScalar', 'multiplyScalar', 'conj', 'size'] -export const createDot = /* #__PURE__ */ factory(name, dependencies, ({ typed, add, multiply }) => { +export const createDot = /* #__PURE__ */ factory(name, dependencies, ({ typed, addScalar, multiplyScalar, conj, size }) => { /** * Calculate the dot product of two vectors. The dot product of - * `A = [a1, a2, a3, ..., an]` and `B = [b1, b2, b3, ..., bn]` is defined as: + * `A = [a1, a2, ..., an]` and `B = [b1, b2, ..., bn]` is defined as: * - * dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn + * dot(A, B) = conj(a1) * b1 + conj(a2) * b2 + ... + conj(an) * bn * * Syntax: * @@ -29,43 +29,138 @@ export const createDot = /* #__PURE__ */ factory(name, dependencies, ({ typed, a * @return {number} Returns the dot product of `x` and `y` */ return typed(name, { - 'Matrix, Matrix': function (x, y) { - return _dot(x.toArray(), y.toArray()) - }, + 'Array | DenseMatrix, Array | DenseMatrix': _denseDot, + 'SparseMatrix, SparseMatrix': _sparseDot + }) - 'Matrix, Array': function (x, y) { - return _dot(x.toArray(), y) - }, + function _validateDim (x, y) { + const xSize = _size(x) + const ySize = _size(y) + let xLen, yLen - 'Array, Matrix': function (x, y) { - return _dot(x, y.toArray()) - }, + if (xSize.length === 1) { + xLen = xSize[0] + } else if (xSize.length === 2 && xSize[1] === 1) { + xLen = xSize[0] + } else { + throw new RangeError('Expected a column vector, instead got a matrix of size (' + xSize.join(', ') + ')') + } - 'Array, Array': _dot - }) + if (ySize.length === 1) { + yLen = ySize[0] + } else if (ySize.length === 2 && ySize[1] === 1) { + yLen = ySize[0] + } else { + throw new RangeError('Expected a column vector, instead got a matrix of size (' + ySize.join(', ') + ')') + } - /** - * Calculate the dot product for two arrays - * @param {Array} x First vector - * @param {Array} y Second vector - * @returns {number} Returns the dot product of x and y - * @private - */ - // TODO: double code with math.multiply - function _dot (x, y) { - const xSize = size(x) - const ySize = size(y) - const len = xSize[0] - - if (xSize.length !== 1 || ySize.length !== 1) throw new RangeError('Vector expected') // TODO: better error message - if (xSize[0] !== ySize[0]) throw new RangeError('Vectors must have equal length (' + xSize[0] + ' != ' + ySize[0] + ')') - if (len === 0) throw new RangeError('Cannot calculate the dot product of empty vectors') - - let prod = 0 - for (let i = 0; i < len; i++) { - prod = add(prod, multiply(x[i], y[i])) + if (xLen !== yLen) throw new RangeError('Vectors must have equal length (' + xLen + ' != ' + yLen + ')') + if (xLen === 0) throw new RangeError('Cannot calculate the dot product of empty vectors') + + return xLen + } + + function _denseDot (a, b) { + const N = _validateDim(a, b) + + const adata = isMatrix(a) ? a._data : a + const adt = isMatrix(a) ? a._datatype : undefined + + const bdata = isMatrix(b) ? b._data : b + const bdt = isMatrix(b) ? b._datatype : undefined + + // are these 2-dimensional column vectors? (as opposed to 1-dimensional vectors) + const aIsColumn = _size(a).length === 2 + const bIsColumn = _size(b).length === 2 + + let add = addScalar + let mul = multiplyScalar + + // process data types + if (adt && bdt && adt === bdt && typeof adt === 'string') { + const dt = adt + // find signatures that matches (dt, dt) + add = typed.find(addScalar, [dt, dt]) + mul = typed.find(multiplyScalar, [dt, dt]) + } + + // both vectors 1-dimensional + if (!aIsColumn && !bIsColumn) { + let c = mul(conj(adata[0]), bdata[0]) + for (let i = 1; i < N; i++) { + c = add(c, mul(conj(adata[i]), bdata[i])) + } + return c } - return prod + // a is 1-dim, b is column + if (!aIsColumn && bIsColumn) { + let c = mul(conj(adata[0]), bdata[0][0]) + for (let i = 1; i < N; i++) { + c = add(c, mul(conj(adata[i]), bdata[i][0])) + } + return c + } + + // a is column, b is 1-dim + if (aIsColumn && !bIsColumn) { + let c = mul(conj(adata[0][0]), bdata[0]) + for (let i = 1; i < N; i++) { + c = add(c, mul(conj(adata[i][0]), bdata[i])) + } + return c + } + + // both vectors are column + if (aIsColumn && bIsColumn) { + let c = mul(conj(adata[0][0]), bdata[0][0]) + for (let i = 1; i < N; i++) { + c = add(c, mul(conj(adata[i][0]), bdata[i][0])) + } + return c + } + } + + function _sparseDot (x, y) { + _validateDim(x, y) + + const xindex = x._index + const xvalues = x._values + + const yindex = y._index + const yvalues = y._values + + // TODO optimize add & mul using datatype + let c = 0 + const add = addScalar + const mul = multiplyScalar + + let i = 0 + let j = 0 + while (i < xindex.length && j < yindex.length) { + const I = xindex[i] + const J = yindex[j] + + if (I < J) { + i++ + continue + } + if (I > J) { + j++ + continue + } + if (I === J) { + c = add(c, mul(xvalues[i], yvalues[j])) + i++ + j++ + } + } + + return c + } + + // TODO remove this once #1771 is fixed + function _size (x) { + return isMatrix(x) ? x.size() : size(x) } }) diff --git a/src/function/matrix/eigs.js b/src/function/matrix/eigs.js index 304da41e18..36b85d6808 100644 --- a/src/function/matrix/eigs.js +++ b/src/function/matrix/eigs.js @@ -1,11 +1,11 @@ -import { clone } from '../../utils/object' -import { factory } from '../../utils/factory' -import { format } from '../../utils/string' +import { clone } from '../../utils/object.js' +import { factory } from '../../utils/factory.js' +import { format } from '../../utils/string.js' const name = 'eigs' -const dependencies = ['typed', 'matrix', 'addScalar', 'equal', 'subtract', 'abs', 'atan', 'cos', 'sin', 'multiplyScalar', 'inv', 'bignumber', 'multiply', 'add'] +const dependencies = ['config', 'typed', 'matrix', 'addScalar', 'equal', 'subtract', 'abs', 'atan', 'cos', 'sin', 'multiplyScalar', 'inv', 'bignumber', 'multiply', 'add'] -export const createEigs = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, addScalar, subtract, equal, abs, atan, cos, sin, multiplyScalar, inv, bignumber, multiply, add }) => { +export const createEigs = /* #__PURE__ */ factory(name, dependencies, ({ config, typed, matrix, addScalar, subtract, equal, abs, atan, cos, sin, multiplyScalar, inv, bignumber, multiply, add }) => { /** * Compute eigenvalue and eigenvector of a real symmetric matrix. * Only applicable to two dimensional symmetric matrices. Uses Jacobi @@ -22,9 +22,10 @@ export const createEigs = /* #__PURE__ */ factory(name, dependencies, ({ typed, * Examples: * * const H = [[5, 2.3], [2.3, 1]] - * const ans = math.eigs(H) // returns {values: [E1,E2...sorted], vectors: [v1,v2.... corresponding vectors]} + * const ans = math.eigs(H) // returns {values: [E1,E2...sorted], vectors: [v1,v2.... corresponding vectors as columns]} * const E = ans.values * const U = ans.vectors + * math.multiply(H, math.column(U, 0)) // returns math.multiply(E[0], math.column(U, 0)) * const UTxHxU = math.multiply(math.transpose(U), H, U) // rotates H to the eigen-representation * E[0] == UTxHxU[0][0] // returns true * See also: @@ -32,9 +33,9 @@ export const createEigs = /* #__PURE__ */ factory(name, dependencies, ({ typed, * inv * * @param {Array | Matrix} x Matrix to be diagonalized - * @return {{values: Array, vectors: Array} | {values: Matrix, vectors: Matrix}} Object containing eigenvalues (Array or Matrix) and eigenvectors (2D Array/Matrix). + * @return {{values: Array, vectors: Array} | {values: Matrix, vectors: Matrix}} Object containing eigenvalues (Array or Matrix) and eigenvectors (2D Array/Matrix with eigenvectors as columns). */ - const eigs = typed('eigs', { + return typed('eigs', { Array: function (x) { // check array size @@ -114,9 +115,9 @@ export const createEigs = /* #__PURE__ */ factory(name, dependencies, ({ typed, } // diagonalization implementation for number (efficient) - function diag (x, precision = 1E-12) { + function diag (x) { const N = x.length - const e0 = Math.abs(precision / N) + const e0 = Math.abs(config.epsilon / N) let psi let Sij = new Array(N) // Sij is Identity Matrix @@ -142,9 +143,9 @@ export const createEigs = /* #__PURE__ */ factory(name, dependencies, ({ typed, } // diagonalization implementation for bigNumber - function diagBig (x, precision = 1E-12) { + function diagBig (x) { const N = x.length - const e0 = abs(precision / N) + const e0 = abs(config.epsilon / N) let psi let Sij = new Array(N) // Sij is Identity Matrix @@ -172,26 +173,22 @@ export const createEigs = /* #__PURE__ */ factory(name, dependencies, ({ typed, // get angle function getTheta (aii, ajj, aij) { - let th = 0 const denom = (ajj - aii) - if (Math.abs(denom) <= 1E-14) { - th = Math.PI / 4.0 + if (Math.abs(denom) <= config.epsilon) { + return Math.PI / 4 } else { - th = 0.5 * Math.atan(2.0 * aij / (ajj - aii)) + return 0.5 * Math.atan(2 * aij / (ajj - aii)) } - return th } // get angle function getThetaBig (aii, ajj, aij) { - let th = 0 const denom = subtract(ajj, aii) - if (abs(denom) <= 1E-14) { - th = Math.PI / 4.0 + if (abs(denom) <= config.epsilon) { + return bignumber(-1).acos().div(4) } else { - th = multiplyScalar(0.5, atan(multiply(2.0, aij, inv(denom)))) + return multiplyScalar(0.5, atan(multiply(2, aij, inv(denom)))) } - return th } // update eigvec @@ -216,8 +213,8 @@ export const createEigs = /* #__PURE__ */ factory(name, dependencies, ({ typed, const N = Sij.length const c = cos(theta) const s = sin(theta) - const Ski = createArray(N, 0) - const Skj = createArray(N, 0) + const Ski = createArray(N, bignumber(0)) + const Skj = createArray(N, bignumber(0)) for (let k = 0; k < N; k++) { Ski[k] = subtract(multiplyScalar(c, Sij[k][i]), multiplyScalar(s, Sij[k][j])) Skj[k] = addScalar(multiplyScalar(s, Sij[k][i]), multiplyScalar(c, Sij[k][j])) @@ -236,10 +233,10 @@ export const createEigs = /* #__PURE__ */ factory(name, dependencies, ({ typed, const s = bignumber(sin(theta)) const c2 = multiplyScalar(c, c) const s2 = multiplyScalar(s, s) - const Aki = createArray(N, 0) - const Akj = createArray(N, 0) + const Aki = createArray(N, bignumber(0)) + const Akj = createArray(N, bignumber(0)) // 2cs Hij - const csHij = multiply(2, c, s, Hij[i][j]) + const csHij = multiply(bignumber(2), c, s, Hij[i][j]) // Aii const Aii = addScalar(subtract(multiplyScalar(c2, Hij[i][i]), csHij), multiplyScalar(s2, Hij[j][j])) const Ajj = add(multiplyScalar(s2, Hij[i][i]), csHij, multiplyScalar(c2, Hij[j][j])) @@ -251,8 +248,8 @@ export const createEigs = /* #__PURE__ */ factory(name, dependencies, ({ typed, // Modify Hij Hij[i][i] = Aii Hij[j][j] = Ajj - Hij[i][j] = 0 - Hij[j][i] = 0 + Hij[i][j] = bignumber(0) + Hij[j][i] = bignumber(0) // 0 to i for (let k = 0; k < N; k++) { if (k !== i && k !== j) { @@ -373,6 +370,4 @@ export const createEigs = /* #__PURE__ */ factory(name, dependencies, ({ typed, return array } - - return eigs }) diff --git a/src/function/matrix/expm.js b/src/function/matrix/expm.js index 8a3e4560fb..df9e94be58 100644 --- a/src/function/matrix/expm.js +++ b/src/function/matrix/expm.js @@ -1,6 +1,6 @@ -import { isSparseMatrix } from '../../utils/is' -import { format } from '../../utils/string' -import { factory } from '../../utils/factory' +import { isSparseMatrix } from '../../utils/is.js' +import { format } from '../../utils/string.js' +import { factory } from '../../utils/factory.js' const name = 'expm' const dependencies = ['typed', 'abs', 'add', 'identity', 'inv', 'multiply'] diff --git a/src/function/matrix/eye.js b/src/function/matrix/eye.js deleted file mode 100644 index ab0a48423f..0000000000 --- a/src/function/matrix/eye.js +++ /dev/null @@ -1,10 +0,0 @@ -// TODO: function eye is removed since v5.0.0 (June 2018). Remove it some day. - -import { factory } from '../../utils/factory' - -export const createEye = /* #__PURE__ */ factory('eye', [], () => { - return function eye () { - throw new Error('Function "eye" is renamed to "identity" since mathjs version 5.0.0. ' + - 'To keep eye working, create an alias for it using "math.import({eye: math.identity}, {override: true})"') - } -}) diff --git a/src/function/matrix/filter.js b/src/function/matrix/filter.js index 0c7957e19c..9a4c14a1a0 100644 --- a/src/function/matrix/filter.js +++ b/src/function/matrix/filter.js @@ -1,6 +1,6 @@ -import { filter, filterRegExp } from '../../utils/array' -import { maxArgumentCount } from '../../utils/function' -import { factory } from '../../utils/factory' +import { filter, filterRegExp } from '../../utils/array.js' +import { maxArgumentCount } from '../../utils/function.js' +import { factory } from '../../utils/factory.js' const name = 'filter' const dependencies = ['typed'] diff --git a/src/function/matrix/flatten.js b/src/function/matrix/flatten.js index 880f6634ff..59505b9acb 100644 --- a/src/function/matrix/flatten.js +++ b/src/function/matrix/flatten.js @@ -1,6 +1,6 @@ -import { clone } from '../../utils/object' -import { flatten as flattenArray } from '../../utils/array' -import { factory } from '../../utils/factory' +import { clone } from '../../utils/object.js' +import { flatten as flattenArray } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'flatten' const dependencies = ['typed', 'matrix'] diff --git a/src/function/matrix/forEach.js b/src/function/matrix/forEach.js index c83bd2e09a..ac76980316 100644 --- a/src/function/matrix/forEach.js +++ b/src/function/matrix/forEach.js @@ -1,6 +1,6 @@ -import { maxArgumentCount } from '../../utils/function' -import { forEach as forEachArray } from '../../utils/array' -import { factory } from '../../utils/factory' +import { maxArgumentCount } from '../../utils/function.js' +import { forEach as forEachArray } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'forEach' const dependencies = ['typed'] diff --git a/src/function/matrix/getMatrixDataType.js b/src/function/matrix/getMatrixDataType.js index a3aa8fa9fb..de008f5cf4 100644 --- a/src/function/matrix/getMatrixDataType.js +++ b/src/function/matrix/getMatrixDataType.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { getArrayDataType } from '../../utils/array' -import { typeOf } from '../../utils/is' +import { factory } from '../../utils/factory.js' +import { getArrayDataType } from '../../utils/array.js' +import { typeOf } from '../../utils/is.js' const name = 'getMatrixDataType' const dependencies = ['typed'] diff --git a/src/function/matrix/identity.js b/src/function/matrix/identity.js index 1e12e33269..5ee1cf0bc6 100644 --- a/src/function/matrix/identity.js +++ b/src/function/matrix/identity.js @@ -1,7 +1,7 @@ -import { isBigNumber } from '../../utils/is' -import { resize } from '../../utils/array' -import { isInteger } from '../../utils/number' -import { factory } from '../../utils/factory' +import { isBigNumber } from '../../utils/is.js' +import { resize } from '../../utils/array.js' +import { isInteger } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' const name = 'identity' const dependencies = [ diff --git a/src/function/matrix/index.js b/src/function/matrix/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/matrix/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/matrix/inv.js b/src/function/matrix/inv.js index 28281a59e1..5065fce27e 100644 --- a/src/function/matrix/inv.js +++ b/src/function/matrix/inv.js @@ -1,7 +1,7 @@ -import { isMatrix } from '../../utils/is' -import { arraySize } from '../../utils/array' -import { factory } from '../../utils/factory' -import { format } from '../../utils/string' +import { isMatrix } from '../../utils/is.js' +import { arraySize } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' +import { format } from '../../utils/string.js' const name = 'inv' const dependencies = [ diff --git a/src/function/matrix/kron.js b/src/function/matrix/kron.js index 8b931e526b..a7a92b1adc 100644 --- a/src/function/matrix/kron.js +++ b/src/function/matrix/kron.js @@ -1,5 +1,5 @@ -import { arraySize as size } from '../../utils/array' -import { factory } from '../../utils/factory' +import { arraySize as size } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'kron' const dependencies = ['typed', 'matrix', 'multiplyScalar'] diff --git a/src/function/matrix/map.js b/src/function/matrix/map.js index 5372cb1078..71a27cd4b5 100644 --- a/src/function/matrix/map.js +++ b/src/function/matrix/map.js @@ -1,5 +1,5 @@ -import { maxArgumentCount } from '../../utils/function' -import { factory } from '../../utils/factory' +import { maxArgumentCount } from '../../utils/function.js' +import { factory } from '../../utils/factory.js' const name = 'map' const dependencies = ['typed'] diff --git a/src/function/matrix/ones.js b/src/function/matrix/ones.js index 5b8c47745f..7e501304c9 100644 --- a/src/function/matrix/ones.js +++ b/src/function/matrix/ones.js @@ -1,7 +1,7 @@ -import { isBigNumber } from '../../utils/is' -import { isInteger } from '../../utils/number' -import { resize } from '../../utils/array' -import { factory } from '../../utils/factory' +import { isBigNumber } from '../../utils/is.js' +import { isInteger } from '../../utils/number.js' +import { resize } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'ones' const dependencies = ['typed', 'config', 'matrix', 'BigNumber'] diff --git a/src/function/matrix/partitionSelect.js b/src/function/matrix/partitionSelect.js index 1f69dad8a3..f1b60e092d 100644 --- a/src/function/matrix/partitionSelect.js +++ b/src/function/matrix/partitionSelect.js @@ -1,6 +1,6 @@ -import { isMatrix } from '../../utils/is' -import { isInteger } from '../../utils/number' -import { factory } from '../../utils/factory' +import { isMatrix } from '../../utils/is.js' +import { isInteger } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' const name = 'partitionSelect' const dependencies = ['typed', 'isNumeric', 'isNaN', 'compare'] diff --git a/src/function/matrix/range.js b/src/function/matrix/range.js index 35b36816f4..13bd8a15e9 100644 --- a/src/function/matrix/range.js +++ b/src/function/matrix/range.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { noBignumber, noMatrix } from '../../utils/noop' +import { factory } from '../../utils/factory.js' +import { noBignumber, noMatrix } from '../../utils/noop.js' const name = 'range' const dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq'] diff --git a/src/function/matrix/reshape.js b/src/function/matrix/reshape.js index 530c2311c5..17e848924f 100644 --- a/src/function/matrix/reshape.js +++ b/src/function/matrix/reshape.js @@ -1,5 +1,5 @@ -import { reshape as arrayReshape } from '../../utils/array' -import { factory } from '../../utils/factory' +import { reshape as arrayReshape } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'reshape' const dependencies = ['typed', 'isInteger', 'matrix'] diff --git a/src/function/matrix/resize.js b/src/function/matrix/resize.js index ea55d04ac7..3f28a91377 100644 --- a/src/function/matrix/resize.js +++ b/src/function/matrix/resize.js @@ -1,11 +1,11 @@ -import { isBigNumber, isMatrix } from '../../utils/is' -import { DimensionError } from '../../error/DimensionError' -import { ArgumentsError } from '../../error/ArgumentsError' -import { isInteger } from '../../utils/number' -import { format } from '../../utils/string' -import { clone } from '../../utils/object' -import { resize as arrayResize } from '../../utils/array' -import { factory } from '../../utils/factory' +import { isBigNumber, isMatrix } from '../../utils/is.js' +import { DimensionError } from '../../error/DimensionError.js' +import { ArgumentsError } from '../../error/ArgumentsError.js' +import { isInteger } from '../../utils/number.js' +import { format } from '../../utils/string.js' +import { clone } from '../../utils/object.js' +import { resize as arrayResize } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'resize' const dependencies = ['config', 'matrix'] diff --git a/src/function/matrix/row.js b/src/function/matrix/row.js index 99eb53a357..33c3f1b442 100644 --- a/src/function/matrix/row.js +++ b/src/function/matrix/row.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { clone } from '../../utils/object' -import { validateIndex } from '../../utils/array' +import { factory } from '../../utils/factory.js' +import { clone } from '../../utils/object.js' +import { validateIndex } from '../../utils/array.js' const name = 'row' const dependencies = ['typed', 'Index', 'matrix', 'range'] @@ -17,7 +17,7 @@ export const createRow = /* #__PURE__ */ factory(name, dependencies, ({ typed, I * * // get a row * const d = [[1, 2], [3, 4]] - * math.row(d, 1) // returns [3, 4] + * math.row(d, 1) // returns [[3, 4]] * * See also: * @@ -27,7 +27,7 @@ export const createRow = /* #__PURE__ */ factory(name, dependencies, ({ typed, I * @param {number} row The index of the row * @return {Array | Matrix} The retrieved row */ - const row = typed(name, { + return typed(name, { 'Matrix, number': _row, 'Array, number': function (value, row) { @@ -35,8 +35,6 @@ export const createRow = /* #__PURE__ */ factory(name, dependencies, ({ typed, I } }) - return row - /** * Retrieve a row of a matrix * @param {Matrix } value A matrix diff --git a/src/function/matrix/size.js b/src/function/matrix/size.js index e3d6fd4ff8..9af7f57c8d 100644 --- a/src/function/matrix/size.js +++ b/src/function/matrix/size.js @@ -1,6 +1,6 @@ -import { arraySize } from '../../utils/array' -import { factory } from '../../utils/factory' -import { noMatrix } from '../../utils/noop' +import { arraySize } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' +import { noMatrix } from '../../utils/noop.js' const name = 'size' const dependencies = ['typed', 'config', '?matrix'] diff --git a/src/function/matrix/sort.js b/src/function/matrix/sort.js index 49a773dad3..104118747c 100644 --- a/src/function/matrix/sort.js +++ b/src/function/matrix/sort.js @@ -1,5 +1,5 @@ -import { arraySize as size } from '../../utils/array' -import { factory } from '../../utils/factory' +import { arraySize as size } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'sort' const dependencies = ['typed', 'matrix', 'compare', 'compareNatural'] diff --git a/src/function/matrix/sqrtm.js b/src/function/matrix/sqrtm.js index 4966183636..1a81e7829e 100644 --- a/src/function/matrix/sqrtm.js +++ b/src/function/matrix/sqrtm.js @@ -1,12 +1,46 @@ -import { isMatrix } from '../../utils/is' -import { format } from '../../utils/string' -import { arraySize } from '../../utils/array' -import { factory } from '../../utils/factory' +import { isMatrix } from '../../utils/is.js' +import { format } from '../../utils/string.js' +import { arraySize } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'sqrtm' const dependencies = ['typed', 'abs', 'add', 'multiply', 'sqrt', 'subtract', 'inv', 'size', 'max', 'identity'] export const createSqrtm = /* #__PURE__ */ factory(name, dependencies, ({ typed, abs, add, multiply, sqrt, subtract, inv, size, max, identity }) => { + const _maxIterations = 1e3 + const _tolerance = 1e-6 + + /** + * Calculate the principal square root matrix using the Denman–Beavers iterative method + * + * https://en.wikipedia.org/wiki/Square_root_of_a_matrix#By_Denman–Beavers_iteration + * + * @param {Array | Matrix} A The square matrix `A` + * @return {Array | Matrix} The principal square root of matrix `A` + * @private + */ + function _denmanBeavers (A) { + let error + let iterations = 0 + + let Y = A + let Z = identity(size(A)) + + do { + const Yk = Y + Y = multiply(0.5, add(Yk, inv(Z))) + Z = multiply(0.5, add(Z, inv(Yk))) + + error = max(abs(subtract(Y, Yk))) + + if (error > _tolerance && ++iterations > _maxIterations) { + throw new Error('computing square root of matrix: iterative method could not converge') + } + } while (error > _tolerance) + + return Y + } + /** * Calculate the principal square root of a square matrix. * The principal square root matrix `X` of another matrix `A` is such that `X * X = A`. @@ -28,7 +62,7 @@ export const createSqrtm = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {Array | Matrix} A The square matrix `A` * @return {Array | Matrix} The principal square root of matrix `A` */ - const sqrtm = typed(name, { + return typed(name, { 'Array | Matrix': function (A) { const size = isMatrix(A) ? A.size() : arraySize(A) switch (size.length) { @@ -56,40 +90,4 @@ export const createSqrtm = /* #__PURE__ */ factory(name, dependencies, ({ typed, } } }) - - const _maxIterations = 1e3 - const _tolerance = 1e-6 - - /** - * Calculate the principal square root matrix using the Denman–Beavers iterative method - * - * https://en.wikipedia.org/wiki/Square_root_of_a_matrix#By_Denman–Beavers_iteration - * - * @param {Array | Matrix} A The square matrix `A` - * @return {Array | Matrix} The principal square root of matrix `A` - * @private - */ - function _denmanBeavers (A) { - let error - let iterations = 0 - - let Y = A - let Z = identity(size(A)) - - do { - const Yk = Y - Y = multiply(0.5, add(Yk, inv(Z))) - Z = multiply(0.5, add(Z, inv(Yk))) - - error = max(abs(subtract(Y, Yk))) - - if (error > _tolerance && ++iterations > _maxIterations) { - throw new Error('computing square root of matrix: iterative method could not converge') - } - } while (error > _tolerance) - - return Y - } - - return sqrtm }) diff --git a/src/function/matrix/squeeze.js b/src/function/matrix/squeeze.js index 5c31042af3..cee45426c7 100644 --- a/src/function/matrix/squeeze.js +++ b/src/function/matrix/squeeze.js @@ -1,6 +1,6 @@ -import { clone } from '../../utils/object' -import { squeeze as arraySqueeze } from '../../utils/array' -import { factory } from '../../utils/factory' +import { clone } from '../../utils/object.js' +import { squeeze as arraySqueeze } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'squeeze' const dependencies = ['typed', 'matrix'] diff --git a/src/function/matrix/subset.js b/src/function/matrix/subset.js index 19a2ef0945..4af7d60f70 100644 --- a/src/function/matrix/subset.js +++ b/src/function/matrix/subset.js @@ -1,9 +1,9 @@ -import { isIndex } from '../../utils/is' -import { clone } from '../../utils/object' -import { validateIndex } from '../../utils/array' -import { getSafeProperty, setSafeProperty } from '../../utils/customs' -import { DimensionError } from '../../error/DimensionError' -import { factory } from '../../utils/factory' +import { isIndex } from '../../utils/is.js' +import { clone } from '../../utils/object.js' +import { validateIndex } from '../../utils/array.js' +import { getSafeProperty, setSafeProperty } from '../../utils/customs.js' +import { DimensionError } from '../../error/DimensionError.js' +import { factory } from '../../utils/factory.js' const name = 'subset' const dependencies = ['typed', 'matrix'] diff --git a/src/function/matrix/trace.js b/src/function/matrix/trace.js index 2857711d67..1d49f2fc52 100644 --- a/src/function/matrix/trace.js +++ b/src/function/matrix/trace.js @@ -1,6 +1,6 @@ -import { clone } from '../../utils/object' -import { format } from '../../utils/string' -import { factory } from '../../utils/factory' +import { clone } from '../../utils/object.js' +import { format } from '../../utils/string.js' +import { factory } from '../../utils/factory.js' const name = 'trace' const dependencies = ['typed', 'matrix', 'add'] diff --git a/src/function/matrix/transpose.js b/src/function/matrix/transpose.js index cdaf8858b4..709e6794cd 100644 --- a/src/function/matrix/transpose.js +++ b/src/function/matrix/transpose.js @@ -1,6 +1,6 @@ -import { clone } from '../../utils/object' -import { format } from '../../utils/string' -import { factory } from '../../utils/factory' +import { clone } from '../../utils/object.js' +import { format } from '../../utils/string.js' +import { factory } from '../../utils/factory.js' const name = 'transpose' const dependencies = ['typed', 'matrix'] @@ -28,11 +28,11 @@ export const createTranspose = /* #__PURE__ */ factory(name, dependencies, ({ ty * @param {Array | Matrix} x Matrix to be transposed * @return {Array | Matrix} The transposed matrix */ - const transpose = typed('transpose', { + return typed('transpose', { Array: function (x) { // use dense matrix implementation - return transpose(matrix(x)).valueOf() + return this(matrix(x)).valueOf() }, Matrix: function (x) { @@ -163,6 +163,4 @@ export const createTranspose = /* #__PURE__ */ factory(name, dependencies, ({ ty datatype: m._datatype }) } - - return transpose }) diff --git a/src/function/matrix/zeros.js b/src/function/matrix/zeros.js index c3888055d7..eb53ceb41e 100644 --- a/src/function/matrix/zeros.js +++ b/src/function/matrix/zeros.js @@ -1,7 +1,7 @@ -import { isBigNumber } from '../../utils/is' -import { isInteger } from '../../utils/number' -import { resize } from '../../utils/array' -import { factory } from '../../utils/factory' +import { isBigNumber } from '../../utils/is.js' +import { isInteger } from '../../utils/number.js' +import { resize } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'zeros' const dependencies = ['typed', 'config', 'matrix', 'BigNumber'] diff --git a/src/function/probability/combinations.js b/src/function/probability/combinations.js index 3f7a701739..e98accb004 100644 --- a/src/function/probability/combinations.js +++ b/src/function/probability/combinations.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { combinationsNumber } from '../../plain/number/combinations' +import { factory } from '../../utils/factory.js' +import { combinationsNumber } from '../../plain/number/combinations.js' const name = 'combinations' const dependencies = ['typed'] diff --git a/src/function/probability/combinationsWithRep.js b/src/function/probability/combinationsWithRep.js index ab7a79ecb4..480f26ee1c 100644 --- a/src/function/probability/combinationsWithRep.js +++ b/src/function/probability/combinationsWithRep.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { isInteger } from '../../utils/number' -import { product } from '../../utils/product' +import { factory } from '../../utils/factory.js' +import { isInteger } from '../../utils/number.js' +import { product } from '../../utils/product.js' const name = 'combinationsWithRep' const dependencies = ['typed'] diff --git a/src/function/probability/factorial.js b/src/function/probability/factorial.js index 5701066ab7..f4d6b390d7 100644 --- a/src/function/probability/factorial.js +++ b/src/function/probability/factorial.js @@ -1,5 +1,5 @@ -import { deepMap } from '../../utils/collection' -import { factory } from '../../utils/factory' +import { deepMap } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' const name = 'factorial' const dependencies = ['typed', 'gamma'] @@ -27,7 +27,7 @@ export const createFactorial = /* #__PURE__ */ factory(name, dependencies, ({ ty * @param {number | BigNumber | Array | Matrix} n An integer number * @return {number | BigNumber | Array | Matrix} The factorial of `n` */ - const factorial = typed(name, { + return typed(name, { number: function (n) { if (n < 0) { throw new Error('Value must be non-negative') @@ -45,9 +45,7 @@ export const createFactorial = /* #__PURE__ */ factory(name, dependencies, ({ ty }, 'Array | Matrix': function (n) { - return deepMap(n, factorial) + return deepMap(n, this) } }) - - return factorial }) diff --git a/src/function/probability/gamma.js b/src/function/probability/gamma.js index 351354dcb9..ea82da83bb 100644 --- a/src/function/probability/gamma.js +++ b/src/function/probability/gamma.js @@ -1,6 +1,6 @@ -import { deepMap } from '../../utils/collection' -import { factory } from '../../utils/factory' -import { gammaG, gammaNumber, gammaP } from '../../plain/number' +import { deepMap } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' +import { gammaG, gammaNumber, gammaP } from '../../plain/number/index.js' const name = 'gamma' const dependencies = ['typed', 'config', 'multiplyScalar', 'pow', 'BigNumber', 'Complex'] @@ -30,13 +30,13 @@ export const createGamma = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | Array | Matrix} The gamma of `n` */ - const gamma = typed(name, { + return typed(name, { number: gammaNumber, Complex: function (n) { if (n.im === 0) { - return gamma(n.re) + return this(n.re) } n = new Complex(n.re - 1, n.im) @@ -90,7 +90,7 @@ export const createGamma = /* #__PURE__ */ factory(name, dependencies, ({ typed, }, 'Array | Matrix': function (n) { - return deepMap(n, gamma) + return deepMap(n, this) } }) @@ -123,6 +123,4 @@ export const createGamma = /* #__PURE__ */ factory(name, dependencies, ({ typed, return new BigNumber(prod.toPrecision(BigNumber.precision)) } - - return gamma }) diff --git a/src/function/probability/index.js b/src/function/probability/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/probability/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/probability/kldivergence.js b/src/function/probability/kldivergence.js index 4b3ad10b7a..7eae4d683b 100644 --- a/src/function/probability/kldivergence.js +++ b/src/function/probability/kldivergence.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'kldivergence' const dependencies = ['typed', 'matrix', 'divide', 'sum', 'multiply', 'dotDivide', 'log', 'isNumeric'] diff --git a/src/function/probability/multinomial.js b/src/function/probability/multinomial.js index 6a5e36a420..d67d839f34 100644 --- a/src/function/probability/multinomial.js +++ b/src/function/probability/multinomial.js @@ -1,5 +1,5 @@ -import { deepForEach } from '../../utils/collection' -import { factory } from '../../utils/factory' +import { deepForEach } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' const name = 'multinomial' const dependencies = ['typed', 'add', 'divide', 'multiply', 'factorial', 'isInteger', 'isPositive'] diff --git a/src/function/probability/permutations.js b/src/function/probability/permutations.js index 0ddd92413f..4cffe4b783 100644 --- a/src/function/probability/permutations.js +++ b/src/function/probability/permutations.js @@ -1,6 +1,6 @@ -import { isInteger } from '../../utils/number' -import { product } from '../../utils/product' -import { factory } from '../../utils/factory' +import { isInteger } from '../../utils/number.js' +import { product } from '../../utils/product.js' +import { factory } from '../../utils/factory.js' const name = 'permutations' const dependencies = ['typed', 'factorial'] diff --git a/src/function/probability/pickRandom.js b/src/function/probability/pickRandom.js index e0104553d6..a9cf3c3489 100644 --- a/src/function/probability/pickRandom.js +++ b/src/function/probability/pickRandom.js @@ -1,7 +1,7 @@ -import { factory } from '../../utils/factory' -import { isNumber } from '../../utils/is' -import { arraySize } from '../../utils/array' -import { createRng } from './util/seededRNG' +import { factory } from '../../utils/factory.js' +import { isNumber } from '../../utils/is.js' +import { arraySize } from '../../utils/array.js' +import { createRng } from './util/seededRNG.js' const name = 'pickRandom' const dependencies = ['typed', 'config', '?on'] diff --git a/src/function/probability/random.js b/src/function/probability/random.js index 9ffdd0557a..c454116b7a 100644 --- a/src/function/probability/random.js +++ b/src/function/probability/random.js @@ -1,7 +1,7 @@ -import { factory } from '../../utils/factory' -import { isMatrix } from '../../utils/is' -import { createRng } from './util/seededRNG' -import { randomMatrix } from './util/randomMatrix' +import { factory } from '../../utils/factory.js' +import { isMatrix } from '../../utils/is.js' +import { createRng } from './util/seededRNG.js' +import { randomMatrix } from './util/randomMatrix.js' const name = 'random' const dependencies = ['typed', 'config', '?on'] diff --git a/src/function/probability/randomInt.js b/src/function/probability/randomInt.js index 775e23f45d..8285bdaa86 100644 --- a/src/function/probability/randomInt.js +++ b/src/function/probability/randomInt.js @@ -1,7 +1,7 @@ -import { factory } from '../../utils/factory' -import { randomMatrix } from './util/randomMatrix' -import { createRng } from './util/seededRNG' -import { isMatrix } from '../../utils/is' +import { factory } from '../../utils/factory.js' +import { randomMatrix } from './util/randomMatrix.js' +import { createRng } from './util/seededRNG.js' +import { isMatrix } from '../../utils/is.js' const name = 'randomInt' const dependencies = ['typed', 'config', '?on'] diff --git a/src/function/relational/compare.js b/src/function/relational/compare.js index 5f19f29fe3..0078dd9893 100644 --- a/src/function/relational/compare.js +++ b/src/function/relational/compare.js @@ -1,11 +1,11 @@ -import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual' -import { nearlyEqual } from '../../utils/number' -import { factory } from '../../utils/factory' -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm05 } from '../../type/matrix/utils/algorithm05' +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js' +import { nearlyEqual } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm05 } from '../../type/matrix/utils/algorithm05.js' const name = 'compare' const dependencies = [ @@ -62,7 +62,7 @@ export const createCompare = /* #__PURE__ */ factory(name, dependencies, ({ type * @return {number | BigNumber | Fraction | Array | Matrix} Returns the result of the comparison: * 1 when x > y, -1 when x < y, and 0 when x == y. */ - const compare = typed(name, { + return typed(name, { 'boolean, boolean': function (x, y) { return x === y ? 0 : (x > y ? 1 : -1) @@ -92,68 +92,66 @@ export const createCompare = /* #__PURE__ */ factory(name, dependencies, ({ type if (!x.equalBase(y)) { throw new Error('Cannot compare units with different base') } - return compare(x.value, y.value) + return this(x.value, y.value) }, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm05(x, y, compare) + return algorithm05(x, y, this) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm03(y, x, compare, true) + return algorithm03(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm03(x, y, compare, false) + return algorithm03(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, compare) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return compare(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return compare(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return compare(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { - return algorithm12(x, y, compare, false) + return algorithm12(x, y, this, false) }, 'DenseMatrix, any': function (x, y) { - return algorithm14(x, y, compare, false) + return algorithm14(x, y, this, false) }, 'any, SparseMatrix': function (x, y) { - return algorithm12(y, x, compare, true) + return algorithm12(y, x, this, true) }, 'any, DenseMatrix': function (x, y) { - return algorithm14(y, x, compare, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, compare, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, compare, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return compare }) export const createCompareNumber = /* #__PURE__ */ factory(name, ['typed', 'config'], ({ typed, config }) => { diff --git a/src/function/relational/compareNatural.js b/src/function/relational/compareNatural.js index 7ce51fa3fe..19e8558b3e 100644 --- a/src/function/relational/compareNatural.js +++ b/src/function/relational/compareNatural.js @@ -1,6 +1,6 @@ import naturalSort from 'javascript-natural-sort' -import { isDenseMatrix, isSparseMatrix, typeOf } from '../../utils/is' -import { factory } from '../../utils/factory' +import { isDenseMatrix, isSparseMatrix, typeOf } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' const name = 'compareNatural' const dependencies = [ @@ -79,7 +79,7 @@ export const createCompareNatural = /* #__PURE__ */ factory(name, dependencies, * @return {number} Returns the result of the comparison: * 1 when x > y, -1 when x < y, and 0 when x == y. */ - const compareNatural = typed(name, { + return typed(name, { 'any, any': function (x, y) { const typeX = typeOf(x) const typeY = typeOf(y) @@ -100,7 +100,7 @@ export const createCompareNatural = /* #__PURE__ */ factory(name, dependencies, // matrix types if (typeX === 'Array' || typeX === 'Matrix' || typeY === 'Array' || typeY === 'Matrix') { - c = compareMatricesAndArrays(x, y) + c = compareMatricesAndArrays(this, x, y) if (c !== 0) { return c } else { @@ -119,11 +119,11 @@ export const createCompareNatural = /* #__PURE__ */ factory(name, dependencies, if (typeX === 'Unit') { if (x.equalBase(y)) { - return compareNatural(x.value, y.value) + return this(x.value, y.value) } // compare by units - return compareArrays(x.formatUnits(), y.formatUnits()) + return compareArrays(this, x.formatUnits(), y.formatUnits()) } if (typeX === 'boolean') { @@ -135,7 +135,7 @@ export const createCompareNatural = /* #__PURE__ */ factory(name, dependencies, } if (typeX === 'Object') { - return compareObjects(x, y) + return compareObjects(this, x, y) } if (typeX === 'null') { @@ -158,36 +158,36 @@ export const createCompareNatural = /* #__PURE__ */ factory(name, dependencies, * @param {Array | SparseMatrix | DenseMatrix | *} y * @returns {number} Returns the comparison result: -1, 0, or 1 */ - function compareMatricesAndArrays (x, y) { + function compareMatricesAndArrays (compareNatural, x, y) { if (isSparseMatrix(x) && isSparseMatrix(y)) { - return compareArrays(x.toJSON().values, y.toJSON().values) + return compareArrays(compareNatural, x.toJSON().values, y.toJSON().values) } if (isSparseMatrix(x)) { // note: convert to array is expensive - return compareMatricesAndArrays(x.toArray(), y) + return compareMatricesAndArrays(compareNatural, x.toArray(), y) } if (isSparseMatrix(y)) { // note: convert to array is expensive - return compareMatricesAndArrays(x, y.toArray()) + return compareMatricesAndArrays(compareNatural, x, y.toArray()) } // convert DenseArray into Array if (isDenseMatrix(x)) { - return compareMatricesAndArrays(x.toJSON().data, y) + return compareMatricesAndArrays(compareNatural, x.toJSON().data, y) } if (isDenseMatrix(y)) { - return compareMatricesAndArrays(x, y.toJSON().data) + return compareMatricesAndArrays(compareNatural, x, y.toJSON().data) } // convert scalars to array if (!Array.isArray(x)) { - return compareMatricesAndArrays([x], y) + return compareMatricesAndArrays(compareNatural, [x], y) } if (!Array.isArray(y)) { - return compareMatricesAndArrays(x, [y]) + return compareMatricesAndArrays(compareNatural, x, [y]) } - return compareArrays(x, y) + return compareArrays(compareNatural, x, y) } /** @@ -201,7 +201,7 @@ export const createCompareNatural = /* #__PURE__ */ factory(name, dependencies, * @param {Array} y * @returns {number} Returns the comparison result: -1, 0, or 1 */ - function compareArrays (x, y) { + function compareArrays (compareNatural, x, y) { // compare each value for (let i = 0, ii = Math.min(x.length, y.length); i < ii; i++) { const v = compareNatural(x[i], y[i]) @@ -228,14 +228,14 @@ export const createCompareNatural = /* #__PURE__ */ factory(name, dependencies, * @param {Object} y * @returns {number} Returns the comparison result: -1, 0, or 1 */ - function compareObjects (x, y) { + function compareObjects (compareNatural, x, y) { const keysX = Object.keys(x) const keysY = Object.keys(y) // compare keys keysX.sort(naturalSort) keysY.sort(naturalSort) - const c = compareArrays(keysX, keysY) + const c = compareArrays(compareNatural, keysX, keysY) if (c !== 0) { return c } @@ -250,8 +250,6 @@ export const createCompareNatural = /* #__PURE__ */ factory(name, dependencies, return 0 } - - return compareNatural }) /** diff --git a/src/function/relational/compareText.js b/src/function/relational/compareText.js index cc00c68982..05b7553e17 100644 --- a/src/function/relational/compareText.js +++ b/src/function/relational/compareText.js @@ -1,7 +1,7 @@ -import { compareText as _compareText } from '../../utils/string' -import { factory } from '../../utils/factory' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' +import { compareText as _compareText } from '../../utils/string.js' +import { factory } from '../../utils/factory.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' const name = 'compareText' const dependencies = [ @@ -41,7 +41,7 @@ export const createCompareText = /* #__PURE__ */ factory(name, dependencies, ({ * @return {number | Array | DenseMatrix} Returns the result of the comparison: * 1 when x > y, -1 when x < y, and 0 when x == y. */ - const compareText = typed(name, { + return typed(name, { 'any, any': _compareText, @@ -51,17 +51,17 @@ export const createCompareText = /* #__PURE__ */ factory(name, dependencies, ({ 'Array, Array': function (x, y) { // use matrix implementation - return compareText(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return compareText(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return compareText(x, matrix(y)) + return this(x, matrix(y)) }, 'DenseMatrix, any': function (x, y) { @@ -82,8 +82,6 @@ export const createCompareText = /* #__PURE__ */ factory(name, dependencies, ({ return algorithm14(matrix(y), x, _compareText, true).valueOf() } }) - - return compareText }) export const createCompareTextNumber = /* #__PURE__ */ factory(name, ['typed'], ({ typed }) => { diff --git a/src/function/relational/deepEqual.js b/src/function/relational/deepEqual.js index b4a9dcfdc4..f693b8b6e9 100644 --- a/src/function/relational/deepEqual.js +++ b/src/function/relational/deepEqual.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'deepEqual' const dependencies = [ diff --git a/src/function/relational/equal.js b/src/function/relational/equal.js index 2d64490ada..94f294e050 100644 --- a/src/function/relational/equal.js +++ b/src/function/relational/equal.js @@ -1,9 +1,9 @@ -import { factory } from '../../utils/factory' -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' +import { factory } from '../../utils/factory.js' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' const name = 'equal' const dependencies = [ @@ -64,7 +64,7 @@ export const createEqual = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | BigNumber | boolean | Complex | Unit | string | Array | Matrix} y Second value to compare * @return {boolean | Array | Matrix} Returns true when the compared values are equal, else returns false */ - const equal = typed(name, { + return typed(name, { 'any, any': function (x, y) { // strict equality for null and undefined? @@ -94,17 +94,17 @@ export const createEqual = /* #__PURE__ */ factory(name, dependencies, ({ typed, 'Array, Array': function (x, y) { // use matrix implementation - return equal(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return equal(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return equal(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { @@ -133,8 +133,6 @@ export const createEqual = /* #__PURE__ */ factory(name, dependencies, ({ typed, return algorithm14(matrix(y), x, equalScalar, true).valueOf() } }) - - return equal }) export const createEqualNumber = factory(name, ['typed', 'equalScalar'], ({ typed, equalScalar }) => { diff --git a/src/function/relational/equalScalar.js b/src/function/relational/equalScalar.js index 6c3aa4d0f9..cedfc085ca 100644 --- a/src/function/relational/equalScalar.js +++ b/src/function/relational/equalScalar.js @@ -1,7 +1,7 @@ -import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual' -import { nearlyEqual } from '../../utils/number' -import { factory } from '../../utils/factory' -import { complexEquals } from '../../utils/complex' +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js' +import { nearlyEqual } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' +import { complexEquals } from '../../utils/complex.js' const name = 'equalScalar' const dependencies = ['typed', 'config'] @@ -15,7 +15,7 @@ export const createEqualScalar = /* #__PURE__ */ factory(name, dependencies, ({ * @return {boolean} Returns true when the compared values are equal, else returns false * @private */ - const equalScalar = typed(name, { + return typed(name, { 'boolean, boolean': function (x, y) { return x === y @@ -41,11 +41,9 @@ export const createEqualScalar = /* #__PURE__ */ factory(name, dependencies, ({ if (!x.equalBase(y)) { throw new Error('Cannot compare units with different base') } - return equalScalar(x.value, y.value) + return this(x.value, y.value) } }) - - return equalScalar }) export const createEqualScalarNumber = factory(name, ['typed', 'config'], ({ typed, config }) => { diff --git a/src/function/relational/equalText.js b/src/function/relational/equalText.js index 2b3c606eda..5751645514 100644 --- a/src/function/relational/equalText.js +++ b/src/function/relational/equalText.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'equalText' const dependencies = [ diff --git a/src/function/relational/index.js b/src/function/relational/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/relational/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/relational/larger.js b/src/function/relational/larger.js index a49e54eb41..1f9f04735a 100644 --- a/src/function/relational/larger.js +++ b/src/function/relational/larger.js @@ -1,11 +1,11 @@ -import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual' -import { nearlyEqual } from '../../utils/number' -import { factory } from '../../utils/factory' -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js' +import { nearlyEqual } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' const name = 'larger' const dependencies = [ @@ -53,7 +53,7 @@ export const createLarger = /* #__PURE__ */ factory(name, dependencies, ({ typed * @param {number | BigNumber | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare * @return {boolean | Array | Matrix} Returns true when the x is larger than y, else returns false */ - const larger = typed(name, { + return typed(name, { 'boolean, boolean': function (x, y) { return x > y @@ -79,68 +79,66 @@ export const createLarger = /* #__PURE__ */ factory(name, dependencies, ({ typed if (!x.equalBase(y)) { throw new Error('Cannot compare units with different base') } - return larger(x.value, y.value) + return this(x.value, y.value) }, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm07(x, y, larger) + return algorithm07(x, y, this) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm03(y, x, larger, true) + return algorithm03(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm03(x, y, larger, false) + return algorithm03(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, larger) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return larger(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return larger(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return larger(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { - return algorithm12(x, y, larger, false) + return algorithm12(x, y, this, false) }, 'DenseMatrix, any': function (x, y) { - return algorithm14(x, y, larger, false) + return algorithm14(x, y, this, false) }, 'any, SparseMatrix': function (x, y) { - return algorithm12(y, x, larger, true) + return algorithm12(y, x, this, true) }, 'any, DenseMatrix': function (x, y) { - return algorithm14(y, x, larger, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, larger, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, larger, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return larger }) export const createLargerNumber = /* #__PURE__ */ factory(name, ['typed', 'config'], ({ typed, config }) => { diff --git a/src/function/relational/largerEq.js b/src/function/relational/largerEq.js index 2493b30d5e..85ce692b58 100644 --- a/src/function/relational/largerEq.js +++ b/src/function/relational/largerEq.js @@ -1,11 +1,11 @@ -import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual' -import { nearlyEqual } from '../../utils/number' -import { factory } from '../../utils/factory' -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js' +import { nearlyEqual } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' const name = 'largerEq' const dependencies = [ @@ -49,7 +49,7 @@ export const createLargerEq = /* #__PURE__ */ factory(name, dependencies, ({ typ * @param {number | BigNumber | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare * @return {boolean | Array | Matrix} Returns true when the x is larger or equal to y, else returns false */ - const largerEq = typed(name, { + return typed(name, { 'boolean, boolean': function (x, y) { return x >= y @@ -75,68 +75,66 @@ export const createLargerEq = /* #__PURE__ */ factory(name, dependencies, ({ typ if (!x.equalBase(y)) { throw new Error('Cannot compare units with different base') } - return largerEq(x.value, y.value) + return this(x.value, y.value) }, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm07(x, y, largerEq) + return algorithm07(x, y, this) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm03(y, x, largerEq, true) + return algorithm03(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm03(x, y, largerEq, false) + return algorithm03(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, largerEq) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return largerEq(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return largerEq(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return largerEq(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { - return algorithm12(x, y, largerEq, false) + return algorithm12(x, y, this, false) }, 'DenseMatrix, any': function (x, y) { - return algorithm14(x, y, largerEq, false) + return algorithm14(x, y, this, false) }, 'any, SparseMatrix': function (x, y) { - return algorithm12(y, x, largerEq, true) + return algorithm12(y, x, this, true) }, 'any, DenseMatrix': function (x, y) { - return algorithm14(y, x, largerEq, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, largerEq, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, largerEq, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return largerEq }) export const createLargerEqNumber = /* #__PURE__ */ factory(name, ['typed', 'config'], ({ typed, config }) => { diff --git a/src/function/relational/smaller.js b/src/function/relational/smaller.js index ccd2bed51d..cf0564d418 100644 --- a/src/function/relational/smaller.js +++ b/src/function/relational/smaller.js @@ -1,11 +1,11 @@ -import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual' -import { nearlyEqual } from '../../utils/number' -import { factory } from '../../utils/factory' -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js' +import { nearlyEqual } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' const name = 'smaller' const dependencies = [ @@ -53,7 +53,7 @@ export const createSmaller = /* #__PURE__ */ factory(name, dependencies, ({ type * @param {number | BigNumber | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false */ - const smaller = typed(name, { + return typed(name, { 'boolean, boolean': function (x, y) { return x < y @@ -79,68 +79,66 @@ export const createSmaller = /* #__PURE__ */ factory(name, dependencies, ({ type if (!x.equalBase(y)) { throw new Error('Cannot compare units with different base') } - return smaller(x.value, y.value) + return this(x.value, y.value) }, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm07(x, y, smaller) + return algorithm07(x, y, this) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm03(y, x, smaller, true) + return algorithm03(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm03(x, y, smaller, false) + return algorithm03(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, smaller) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return smaller(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return smaller(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return smaller(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { - return algorithm12(x, y, smaller, false) + return algorithm12(x, y, this, false) }, 'DenseMatrix, any': function (x, y) { - return algorithm14(x, y, smaller, false) + return algorithm14(x, y, this, false) }, 'any, SparseMatrix': function (x, y) { - return algorithm12(y, x, smaller, true) + return algorithm12(y, x, this, true) }, 'any, DenseMatrix': function (x, y) { - return algorithm14(y, x, smaller, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, smaller, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, smaller, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return smaller }) export const createSmallerNumber = /* #__PURE__ */ factory(name, ['typed', 'config'], ({ typed, config }) => { diff --git a/src/function/relational/smallerEq.js b/src/function/relational/smallerEq.js index dfa59623af..3b9b755eb2 100644 --- a/src/function/relational/smallerEq.js +++ b/src/function/relational/smallerEq.js @@ -1,11 +1,11 @@ -import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual' -import { nearlyEqual } from '../../utils/number' -import { factory } from '../../utils/factory' -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' +import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js' +import { nearlyEqual } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' const name = 'smallerEq' const dependencies = [ @@ -49,7 +49,7 @@ export const createSmallerEq = /* #__PURE__ */ factory(name, dependencies, ({ ty * @param {number | BigNumber | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false */ - const smallerEq = typed(name, { + return typed(name, { 'boolean, boolean': function (x, y) { return x <= y @@ -75,68 +75,66 @@ export const createSmallerEq = /* #__PURE__ */ factory(name, dependencies, ({ ty if (!x.equalBase(y)) { throw new Error('Cannot compare units with different base') } - return smallerEq(x.value, y.value) + return this(x.value, y.value) }, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm07(x, y, smallerEq) + return algorithm07(x, y, this) }, 'SparseMatrix, DenseMatrix': function (x, y) { - return algorithm03(y, x, smallerEq, true) + return algorithm03(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm03(x, y, smallerEq, false) + return algorithm03(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, smallerEq) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return smallerEq(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return smallerEq(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return smallerEq(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { - return algorithm12(x, y, smallerEq, false) + return algorithm12(x, y, this, false) }, 'DenseMatrix, any': function (x, y) { - return algorithm14(x, y, smallerEq, false) + return algorithm14(x, y, this, false) }, 'any, SparseMatrix': function (x, y) { - return algorithm12(y, x, smallerEq, true) + return algorithm12(y, x, this, true) }, 'any, DenseMatrix': function (x, y) { - return algorithm14(y, x, smallerEq, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, smallerEq, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, smallerEq, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return smallerEq }) export const createSmallerEqNumber = /* #__PURE__ */ factory(name, ['typed', 'config'], ({ typed, config }) => { diff --git a/src/function/relational/unequal.js b/src/function/relational/unequal.js index 31aacde935..9ba26b8a85 100644 --- a/src/function/relational/unequal.js +++ b/src/function/relational/unequal.js @@ -1,9 +1,9 @@ -import { factory } from '../../utils/factory' -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' +import { factory } from '../../utils/factory.js' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' const name = 'unequal' const dependencies = [ @@ -64,7 +64,7 @@ export const createUnequal = /* #__PURE__ */ factory(name, dependencies, ({ type * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} y Second value to compare * @return {boolean | Array | Matrix} Returns true when the compared values are unequal, else returns false */ - const unequal = typed('unequal', { + return typed('unequal', { 'any, any': function (x, y) { // strict equality for null and undefined? @@ -94,17 +94,17 @@ export const createUnequal = /* #__PURE__ */ factory(name, dependencies, ({ type 'Array, Array': function (x, y) { // use matrix implementation - return unequal(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return unequal(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return unequal(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, any': function (x, y) { @@ -137,8 +137,6 @@ export const createUnequal = /* #__PURE__ */ factory(name, dependencies, ({ type function _unequal (x, y) { return !equalScalar(x, y) } - - return unequal }) export const createUnequalNumber = factory(name, ['typed', 'equalScalar'], ({ typed, equalScalar }) => { diff --git a/src/function/set/index.js b/src/function/set/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/set/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/set/setCartesian.js b/src/function/set/setCartesian.js index 2b3622c394..6df3884564 100644 --- a/src/function/set/setCartesian.js +++ b/src/function/set/setCartesian.js @@ -1,5 +1,5 @@ -import { flatten } from '../../utils/array' -import { factory } from '../../utils/factory' +import { flatten } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'setCartesian' const dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'] diff --git a/src/function/set/setDifference.js b/src/function/set/setDifference.js index ccad637905..872c369e95 100644 --- a/src/function/set/setDifference.js +++ b/src/function/set/setDifference.js @@ -1,5 +1,5 @@ -import { flatten, generalize, identify } from '../../utils/array' -import { factory } from '../../utils/factory' +import { flatten, generalize, identify } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'setDifference' const dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'] diff --git a/src/function/set/setDistinct.js b/src/function/set/setDistinct.js index 463ee9b66c..0cedd94c1f 100644 --- a/src/function/set/setDistinct.js +++ b/src/function/set/setDistinct.js @@ -1,5 +1,5 @@ -import { flatten } from '../../utils/array' -import { factory } from '../../utils/factory' +import { flatten } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'setDistinct' const dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'] diff --git a/src/function/set/setIntersect.js b/src/function/set/setIntersect.js index 2ea74a238e..4f2845e507 100644 --- a/src/function/set/setIntersect.js +++ b/src/function/set/setIntersect.js @@ -1,5 +1,5 @@ -import { flatten, generalize, identify } from '../../utils/array' -import { factory } from '../../utils/factory' +import { flatten, generalize, identify } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'setIntersect' const dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'] diff --git a/src/function/set/setIsSubset.js b/src/function/set/setIsSubset.js index 00e3894546..3cd7ebc638 100644 --- a/src/function/set/setIsSubset.js +++ b/src/function/set/setIsSubset.js @@ -1,5 +1,5 @@ -import { flatten, identify } from '../../utils/array' -import { factory } from '../../utils/factory' +import { flatten, identify } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'setIsSubset' const dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'] diff --git a/src/function/set/setMultiplicity.js b/src/function/set/setMultiplicity.js index 9bd5b0d4c8..7935ac210e 100644 --- a/src/function/set/setMultiplicity.js +++ b/src/function/set/setMultiplicity.js @@ -1,5 +1,5 @@ -import { flatten } from '../../utils/array' -import { factory } from '../../utils/factory' +import { flatten } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'setMultiplicity' const dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'] diff --git a/src/function/set/setPowerset.js b/src/function/set/setPowerset.js index a33f194890..9737854e0a 100644 --- a/src/function/set/setPowerset.js +++ b/src/function/set/setPowerset.js @@ -1,5 +1,5 @@ -import { flatten } from '../../utils/array' -import { factory } from '../../utils/factory' +import { flatten } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'setPowerset' const dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'] diff --git a/src/function/set/setSize.js b/src/function/set/setSize.js index 7bf0e82d4b..81f6c09218 100644 --- a/src/function/set/setSize.js +++ b/src/function/set/setSize.js @@ -1,5 +1,5 @@ -import { flatten } from '../../utils/array' -import { factory } from '../../utils/factory' +import { flatten } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'setSize' const dependencies = ['typed', 'compareNatural'] diff --git a/src/function/set/setSymDifference.js b/src/function/set/setSymDifference.js index acd5ee4409..812cfbc586 100644 --- a/src/function/set/setSymDifference.js +++ b/src/function/set/setSymDifference.js @@ -1,5 +1,5 @@ -import { flatten } from '../../utils/array' -import { factory } from '../../utils/factory' +import { flatten } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'setSymDifference' const dependencies = ['typed', 'size', 'concat', 'subset', 'setDifference', 'Index'] diff --git a/src/function/set/setUnion.js b/src/function/set/setUnion.js index 9dcde0d7af..ce53bea081 100644 --- a/src/function/set/setUnion.js +++ b/src/function/set/setUnion.js @@ -1,5 +1,5 @@ -import { flatten } from '../../utils/array' -import { factory } from '../../utils/factory' +import { flatten } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'setUnion' const dependencies = ['typed', 'size', 'concat', 'subset', 'setIntersect', 'setSymDifference', 'Index'] diff --git a/src/function/special/erf.js b/src/function/special/erf.js index 34317afab4..ce992ddc9b 100644 --- a/src/function/special/erf.js +++ b/src/function/special/erf.js @@ -1,6 +1,6 @@ -import { deepMap } from '../../utils/collection' -import { sign } from '../../utils/number' -import { factory } from '../../utils/factory' +import { deepMap } from '../../utils/collection.js' +import { sign } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' const name = 'erf' const dependencies = [ @@ -32,7 +32,7 @@ export const createErf = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @param {number | Array | Matrix} x A real number * @return {number | Array | Matrix} The erf of `x` */ - const erf = typed('name', { + return typed('name', { number: function (x) { const y = Math.abs(x) @@ -49,7 +49,7 @@ export const createErf = /* #__PURE__ */ factory(name, dependencies, ({ typed }) }, 'Array | Matrix': function (n) { - return deepMap(n, erf) + return deepMap(n, this) } // TODO: For complex numbers, use the approximation for the Faddeeva function @@ -123,8 +123,6 @@ export const createErf = /* #__PURE__ */ factory(name, dependencies, ({ typed }) const del = (y - ysq) * (y + ysq) return Math.exp(-ysq * ysq) * Math.exp(-del) * result } - - return erf }) /** diff --git a/src/function/special/index.js b/src/function/special/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/special/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/statistics/index.js b/src/function/statistics/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/statistics/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/statistics/mad.js b/src/function/statistics/mad.js index 86b5a2ef98..baa7fa75b1 100644 --- a/src/function/statistics/mad.js +++ b/src/function/statistics/mad.js @@ -1,6 +1,6 @@ -import { flatten } from '../../utils/array' -import { factory } from '../../utils/factory' -import { improveErrorMessage } from './utils/improveErrorMessage' +import { flatten } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' +import { improveErrorMessage } from './utils/improveErrorMessage.js' const name = 'mad' const dependencies = ['typed', 'abs', 'map', 'median', 'subtract'] diff --git a/src/function/statistics/max.js b/src/function/statistics/max.js index 8f0420cae4..c1e8091c2a 100644 --- a/src/function/statistics/max.js +++ b/src/function/statistics/max.js @@ -1,11 +1,11 @@ -import { deepForEach, reduce, containsCollections } from '../../utils/collection' -import { factory } from '../../utils/factory' -import { improveErrorMessage } from './utils/improveErrorMessage' +import { deepForEach, reduce, containsCollections } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' +import { improveErrorMessage } from './utils/improveErrorMessage.js' const name = 'max' -const dependencies = ['typed', 'larger'] +const dependencies = ['typed', 'config', 'numeric', 'larger'] -export const createMax = /* #__PURE__ */ factory(name, dependencies, ({ typed, larger }) => { +export const createMax = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, numeric, larger }) => { /** * Compute the maximum value of a matrix or a list with values. * In case of a multi dimensional array, the maximum of the flattened array @@ -96,6 +96,11 @@ export const createMax = /* #__PURE__ */ factory(name, dependencies, ({ typed, l throw new Error('Cannot calculate max of an empty array') } + // make sure returning numeric value: parse a string into a numeric value + if (typeof res === 'string') { + res = numeric(res, config.number) + } + return res } }) diff --git a/src/function/statistics/mean.js b/src/function/statistics/mean.js index 557d71e039..995aa34169 100644 --- a/src/function/statistics/mean.js +++ b/src/function/statistics/mean.js @@ -1,7 +1,7 @@ -import { containsCollections, deepForEach, reduce } from '../../utils/collection' -import { arraySize } from '../../utils/array' -import { factory } from '../../utils/factory' -import { improveErrorMessage } from './utils/improveErrorMessage' +import { containsCollections, deepForEach, reduce } from '../../utils/collection.js' +import { arraySize } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' +import { improveErrorMessage } from './utils/improveErrorMessage.js' const name = 'mean' const dependencies = ['typed', 'add', 'divide'] diff --git a/src/function/statistics/median.js b/src/function/statistics/median.js index badb23d1a2..8d8d02f9b3 100644 --- a/src/function/statistics/median.js +++ b/src/function/statistics/median.js @@ -1,59 +1,12 @@ -import { containsCollections } from '../../utils/collection' -import { flatten } from '../../utils/array' -import { factory } from '../../utils/factory' -import { improveErrorMessage } from './utils/improveErrorMessage' +import { containsCollections } from '../../utils/collection.js' +import { flatten } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' +import { improveErrorMessage } from './utils/improveErrorMessage.js' const name = 'median' const dependencies = ['typed', 'add', 'divide', 'compare', 'partitionSelect'] export const createMedian = /* #__PURE__ */ factory(name, dependencies, ({ typed, add, divide, compare, partitionSelect }) => { - /** - * Compute the median of a matrix or a list with values. The values are - * sorted and the middle value is returned. In case of an even number of - * values, the average of the two middle values is returned. - * Supported types of values are: Number, BigNumber, Unit - * - * In case of a (multi dimensional) array or matrix, the median of all - * elements will be calculated. - * - * Syntax: - * - * math.median(a, b, c, ...) - * math.median(A) - * - * Examples: - * - * math.median(5, 2, 7) // returns 5 - * math.median([3, -1, 5, 7]) // returns 4 - * - * See also: - * - * mean, min, max, sum, prod, std, variance, quantileSeq - * - * @param {... *} args A single matrix or or multiple scalar values - * @return {*} The median - */ - const median = typed(name, { - // median([a, b, c, d, ...]) - 'Array | Matrix': _median, - - // median([a, b, c, d, ...], dim) - 'Array | Matrix, number | BigNumber': function (array, dim) { - // TODO: implement median(A, dim) - throw new Error('median(A, dim) is not yet supported') - // return reduce(arguments[0], arguments[1], ...) - }, - - // median(a, b, c, d, ...) - '...': function (args) { - if (containsCollections(args)) { - throw new TypeError('Scalar values expected in function median') - } - - return _median(args) - } - }) - /** * Recursively calculate the median of an n-dimensional array * @param {Array} array @@ -108,5 +61,50 @@ export const createMedian = /* #__PURE__ */ factory(name, dependencies, ({ typed } }) - return median + /** + * Compute the median of a matrix or a list with values. The values are + * sorted and the middle value is returned. In case of an even number of + * values, the average of the two middle values is returned. + * Supported types of values are: Number, BigNumber, Unit + * + * In case of a (multi dimensional) array or matrix, the median of all + * elements will be calculated. + * + * Syntax: + * + * math.median(a, b, c, ...) + * math.median(A) + * + * Examples: + * + * math.median(5, 2, 7) // returns 5 + * math.median([3, -1, 5, 7]) // returns 4 + * + * See also: + * + * mean, min, max, sum, prod, std, variance, quantileSeq + * + * @param {... *} args A single matrix or or multiple scalar values + * @return {*} The median + */ + return typed(name, { + // median([a, b, c, d, ...]) + 'Array | Matrix': _median, + + // median([a, b, c, d, ...], dim) + 'Array | Matrix, number | BigNumber': function (array, dim) { + // TODO: implement median(A, dim) + throw new Error('median(A, dim) is not yet supported') + // return reduce(arguments[0], arguments[1], ...) + }, + + // median(a, b, c, d, ...) + '...': function (args) { + if (containsCollections(args)) { + throw new TypeError('Scalar values expected in function median') + } + + return _median(args) + } + }) }) diff --git a/src/function/statistics/min.js b/src/function/statistics/min.js index e4a007835e..4a2dd957f2 100644 --- a/src/function/statistics/min.js +++ b/src/function/statistics/min.js @@ -1,11 +1,11 @@ -import { containsCollections, deepForEach, reduce } from '../../utils/collection' -import { factory } from '../../utils/factory' -import { improveErrorMessage } from './utils/improveErrorMessage' +import { containsCollections, deepForEach, reduce } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' +import { improveErrorMessage } from './utils/improveErrorMessage.js' const name = 'min' -const dependencies = ['typed', 'smaller'] +const dependencies = ['typed', 'config', 'numeric', 'smaller'] -export const createMin = /* #__PURE__ */ factory(name, dependencies, ({ typed, smaller }) => { +export const createMin = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, numeric, smaller }) => { /** * Compute the minimum value of a matrix or a list of values. * In case of a multi dimensional array, the minimum of the flattened array @@ -96,6 +96,11 @@ export const createMin = /* #__PURE__ */ factory(name, dependencies, ({ typed, s throw new Error('Cannot calculate min of an empty array') } + // make sure returning numeric value: parse a string into a numeric value + if (typeof min === 'string') { + min = numeric(min, config.number) + } + return min } }) diff --git a/src/function/statistics/mode.js b/src/function/statistics/mode.js index 5777babb75..b20512df6a 100644 --- a/src/function/statistics/mode.js +++ b/src/function/statistics/mode.js @@ -1,5 +1,5 @@ -import { flatten } from '../../utils/array' -import { factory } from '../../utils/factory' +import { flatten } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'mode' const dependencies = ['typed', 'isNaN', 'isNumeric'] diff --git a/src/function/statistics/prod.js b/src/function/statistics/prod.js index fd23f8a56f..3a9091ae97 100644 --- a/src/function/statistics/prod.js +++ b/src/function/statistics/prod.js @@ -1,11 +1,11 @@ -import { deepForEach } from '../../utils/collection' -import { factory } from '../../utils/factory' -import { improveErrorMessage } from './utils/improveErrorMessage' +import { deepForEach } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' +import { improveErrorMessage } from './utils/improveErrorMessage.js' const name = 'prod' -const dependencies = ['typed', 'multiply'] +const dependencies = ['typed', 'config', 'multiplyScalar', 'numeric'] -export const createProd = /* #__PURE__ */ factory(name, dependencies, ({ typed, multiply }) => { +export const createProd = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, multiplyScalar, numeric }) => { /** * Compute the product of a matrix or a list with values. * In case of a (multi dimensional) array or matrix, the sum of all @@ -59,12 +59,17 @@ export const createProd = /* #__PURE__ */ factory(name, dependencies, ({ typed, deepForEach(array, function (value) { try { - prod = (prod === undefined) ? value : multiply(prod, value) + prod = (prod === undefined) ? value : multiplyScalar(prod, value) } catch (err) { throw improveErrorMessage(err, 'prod', value) } }) + // make sure returning numeric value: parse a string into a numeric value + if (typeof prod === 'string') { + prod = numeric(prod, config.number) + } + if (prod === undefined) { throw new Error('Cannot calculate prod of an empty array') } diff --git a/src/function/statistics/quantileSeq.js b/src/function/statistics/quantileSeq.js index d4c80371e8..3a8950023a 100644 --- a/src/function/statistics/quantileSeq.js +++ b/src/function/statistics/quantileSeq.js @@ -1,7 +1,7 @@ -import { isBigNumber, isCollection, isNumber } from '../../utils/is' -import { isInteger } from '../../utils/number' -import { flatten } from '../../utils/array' -import { factory } from '../../utils/factory' +import { isBigNumber, isCollection, isNumber } from '../../utils/is.js' +import { isInteger } from '../../utils/number.js' +import { flatten } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' const name = 'quantileSeq' const dependencies = ['typed', 'add', 'multiply', 'partitionSelect', 'compare'] diff --git a/src/function/statistics/std.js b/src/function/statistics/std.js index a26ffd5e3c..f19d282665 100644 --- a/src/function/statistics/std.js +++ b/src/function/statistics/std.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'std' const dependencies = ['typed', 'sqrt', 'variance'] diff --git a/src/function/statistics/sum.js b/src/function/statistics/sum.js index c21a031e89..de1976e15b 100644 --- a/src/function/statistics/sum.js +++ b/src/function/statistics/sum.js @@ -1,12 +1,11 @@ -import { containsCollections, deepForEach, reduce } from '../../utils/collection' -import { factory } from '../../utils/factory' -import { improveErrorMessage } from './utils/improveErrorMessage' -import { noBignumber, noFraction } from '../../utils/noop' +import { containsCollections, deepForEach, reduce } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' +import { improveErrorMessage } from './utils/improveErrorMessage.js' const name = 'sum' -const dependencies = ['typed', 'config', 'add', '?bignumber', '?fraction'] +const dependencies = ['typed', 'config', 'add', 'numeric'] -export const createSum = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, add, bignumber, fraction }) => { +export const createSum = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, add, numeric }) => { /** * Compute the sum of a matrix or a list with values. * In case of a (multi dimensional) array or matrix, the sum of all @@ -49,7 +48,7 @@ export const createSum = /* #__PURE__ */ factory(name, dependencies, ({ typed, c /** * Recursively calculate the sum of an n-dimensional array - * @param {Array} array + * @param {Array | Matrix} array * @return {number} sum * @private */ @@ -64,17 +63,12 @@ export const createSum = /* #__PURE__ */ factory(name, dependencies, ({ typed, c } }) + // make sure returning numeric value: parse a string into a numeric value if (sum === undefined) { - switch (config.number) { - case 'number': - return 0 - case 'BigNumber': - return bignumber ? bignumber(0) : noBignumber() - case 'Fraction': - return fraction ? fraction(0) : noFraction() - default: - return 0 - } + sum = numeric(0, config.number) + } + if (typeof sum === 'string') { + sum = numeric(sum, config.number) } return sum diff --git a/src/function/statistics/utils/improveErrorMessage.js b/src/function/statistics/utils/improveErrorMessage.js index 044a6b227f..e31a71bfba 100644 --- a/src/function/statistics/utils/improveErrorMessage.js +++ b/src/function/statistics/utils/improveErrorMessage.js @@ -1,4 +1,4 @@ -import { typeOf } from '../../../utils/is' +import { typeOf } from '../../../utils/is.js' /** * Improve error messages for statistics functions. Errors are typically diff --git a/src/function/statistics/variance.js b/src/function/statistics/variance.js index e84db1e94a..9c3e151bd6 100644 --- a/src/function/statistics/variance.js +++ b/src/function/statistics/variance.js @@ -1,8 +1,7 @@ -import { deepForEach } from '../../utils/collection' -import { isBigNumber } from '../../utils/is' -import { factory } from '../../utils/factory' -import { improveErrorMessage } from './utils/improveErrorMessage' -import { warnOnce } from '../../utils/log' +import { deepForEach } from '../../utils/collection.js' +import { isBigNumber } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' +import { improveErrorMessage } from './utils/improveErrorMessage.js' const DEFAULT_NORMALIZATION = 'unbiased' @@ -159,12 +158,3 @@ export const createVariance = /* #__PURE__ */ factory(name, dependencies, ({ typ } } }) - -// For backward compatibility, deprecated since version 6.0.0. Date: 2018-11-09 -export const createDeprecatedVar = /* #__PURE__ */ factory('var', ['variance'], ({ variance }) => { - return function (...args) { - warnOnce('Function "var" has been renamed to "variance" in v6.0.0, please use the new function instead.') - - return variance.apply(variance, args) - } -}) diff --git a/src/function/string/format.js b/src/function/string/format.js index e592b84967..10a7da4541 100644 --- a/src/function/string/format.js +++ b/src/function/string/format.js @@ -1,5 +1,5 @@ -import { format as formatString } from '../../utils/string' -import { factory } from '../../utils/factory' +import { format as formatString } from '../../utils/string.js' +import { factory } from '../../utils/factory.js' const name = 'format' const dependencies = ['typed'] @@ -30,7 +30,8 @@ export const createFormat = /* #__PURE__ */ factory(name, dependencies, ({ typed * Always use exponential notation. * For example '1.234e+2' and '1.4e+7' * - 'engineering' - * Always use engineering notation. + * Always use engineering notation: always have exponential notation, + * and select the exponent to be a multiple of 3. * For example '123.4e+0' and '14.0e+6' * - 'auto' (default) * Regular number notation for numbers having an absolute value between diff --git a/src/function/string/index.js b/src/function/string/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/string/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/string/print.js b/src/function/string/print.js index 90b0fa9a91..bc35713f9f 100644 --- a/src/function/string/print.js +++ b/src/function/string/print.js @@ -1,6 +1,6 @@ -import { format } from '../../utils/string' -import { isString } from '../../utils/is' -import { factory } from '../../utils/factory' +import { format } from '../../utils/string.js' +import { isString } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' const name = 'print' const dependencies = ['typed'] diff --git a/src/function/trigonometry/acos.js b/src/function/trigonometry/acos.js index aff0ba1ed4..1882d91048 100644 --- a/src/function/trigonometry/acos.js +++ b/src/function/trigonometry/acos.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' const name = 'acos' const dependencies = ['typed', 'config', 'Complex'] @@ -28,7 +28,7 @@ export const createAcos = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | BigNumber | Complex | Array | Matrix} x Function input * @return {number | BigNumber | Complex | Array | Matrix} The arc cosine of x */ - const acos = typed(name, { + return typed(name, { number: function (x) { if ((x >= -1 && x <= 1) || config.predictable) { return Math.acos(x) @@ -46,9 +46,7 @@ export const createAcos = /* #__PURE__ */ factory(name, dependencies, ({ typed, }, 'Array | Matrix': function (x) { - return deepMap(x, acos) + return deepMap(x, this) } }) - - return acos }) diff --git a/src/function/trigonometry/acosh.js b/src/function/trigonometry/acosh.js index 730caebbe9..7fbe1d1280 100644 --- a/src/function/trigonometry/acosh.js +++ b/src/function/trigonometry/acosh.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { acoshNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { acoshNumber } from '../../plain/number/index.js' const name = 'acosh' const dependencies = ['typed', 'config', 'Complex'] @@ -27,7 +27,7 @@ export const createAcosh = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | Complex | Unit | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} Hyperbolic arccosine of x */ - const acosh = typed(name, { + return typed(name, { number: function (x) { if (x >= 1 || config.predictable) { return acoshNumber(x) @@ -47,9 +47,7 @@ export const createAcosh = /* #__PURE__ */ factory(name, dependencies, ({ typed, }, 'Array | Matrix': function (x) { - return deepMap(x, acosh) + return deepMap(x, this) } }) - - return acosh }) diff --git a/src/function/trigonometry/acot.js b/src/function/trigonometry/acot.js index b129cca840..07dd3166c1 100644 --- a/src/function/trigonometry/acot.js +++ b/src/function/trigonometry/acot.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { acotNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { acotNumber } from '../../plain/number/index.js' const name = 'acot' const dependencies = ['typed', 'BigNumber'] @@ -29,7 +29,7 @@ export const createAcot = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | Complex | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} The arc cotangent of x */ - const acot = typed(name, { + return typed(name, { number: acotNumber, Complex: function (x) { @@ -41,9 +41,7 @@ export const createAcot = /* #__PURE__ */ factory(name, dependencies, ({ typed, }, 'Array | Matrix': function (x) { - return deepMap(x, acot) + return deepMap(x, this) } }) - - return acot }) diff --git a/src/function/trigonometry/acoth.js b/src/function/trigonometry/acoth.js index 1796dc1d6e..96ec9ac188 100644 --- a/src/function/trigonometry/acoth.js +++ b/src/function/trigonometry/acoth.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { acothNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { acothNumber } from '../../plain/number/index.js' const name = 'acoth' const dependencies = ['typed', 'config', 'Complex', 'BigNumber'] @@ -27,7 +27,7 @@ export const createAcoth = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | Complex | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} Hyperbolic arccotangent of x */ - const acoth = typed(name, { + return typed(name, { number: function (x) { if (x >= 1 || x <= -1 || config.predictable) { return acothNumber(x) @@ -44,9 +44,7 @@ export const createAcoth = /* #__PURE__ */ factory(name, dependencies, ({ typed, }, 'Array | Matrix': function (x) { - return deepMap(x, acoth) + return deepMap(x, this) } }) - - return acoth }) diff --git a/src/function/trigonometry/acsc.js b/src/function/trigonometry/acsc.js index 74c748e491..620c44cbd8 100644 --- a/src/function/trigonometry/acsc.js +++ b/src/function/trigonometry/acsc.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { acscNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { acscNumber } from '../../plain/number/index.js' const name = 'acsc' const dependencies = ['typed', 'config', 'Complex', 'BigNumber'] @@ -29,7 +29,7 @@ export const createAcsc = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | Complex | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} The arc cosecant of x */ - const acsc = typed(name, { + return typed(name, { number: function (x) { if (x <= -1 || x >= 1 || config.predictable) { return acscNumber(x) @@ -46,9 +46,7 @@ export const createAcsc = /* #__PURE__ */ factory(name, dependencies, ({ typed, }, 'Array | Matrix': function (x) { - return deepMap(x, acsc) + return deepMap(x, this) } }) - - return acsc }) diff --git a/src/function/trigonometry/acsch.js b/src/function/trigonometry/acsch.js index 75a8b5ff88..ff7c3d0232 100644 --- a/src/function/trigonometry/acsch.js +++ b/src/function/trigonometry/acsch.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { acschNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { acschNumber } from '../../plain/number/index.js' const name = 'acsch' const dependencies = ['typed', 'BigNumber'] @@ -27,7 +27,7 @@ export const createAcsch = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | Complex | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} Hyperbolic arccosecant of x */ - const acsch = typed(name, { + return typed(name, { number: acschNumber, Complex: function (x) { @@ -39,9 +39,7 @@ export const createAcsch = /* #__PURE__ */ factory(name, dependencies, ({ typed, }, 'Array | Matrix': function (x) { - return deepMap(x, acsch) + return deepMap(x, this) } }) - - return acsch }) diff --git a/src/function/trigonometry/asec.js b/src/function/trigonometry/asec.js index 1c68449674..451094a234 100644 --- a/src/function/trigonometry/asec.js +++ b/src/function/trigonometry/asec.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { asecNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { asecNumber } from '../../plain/number/index.js' const name = 'asec' const dependencies = ['typed', 'config', 'Complex', 'BigNumber'] @@ -29,7 +29,7 @@ export const createAsec = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | Complex | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} The arc secant of x */ - const asec = typed(name, { + return typed(name, { number: function (x) { if (x <= -1 || x >= 1 || config.predictable) { return asecNumber(x) @@ -46,9 +46,7 @@ export const createAsec = /* #__PURE__ */ factory(name, dependencies, ({ typed, }, 'Array | Matrix': function (x) { - return deepMap(x, asec) + return deepMap(x, this) } }) - - return asec }) diff --git a/src/function/trigonometry/asech.js b/src/function/trigonometry/asech.js index 091bbd682d..7576f952e4 100644 --- a/src/function/trigonometry/asech.js +++ b/src/function/trigonometry/asech.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { asechNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { asechNumber } from '../../plain/number/index.js' const name = 'asech' const dependencies = ['typed', 'config', 'Complex', 'BigNumber'] @@ -27,7 +27,7 @@ export const createAsech = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | Complex | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} Hyperbolic arcsecant of x */ - const asech = typed(name, { + return typed(name, { number: function (x) { if ((x <= 1 && x >= -1) || config.predictable) { const xInv = 1 / x @@ -51,9 +51,7 @@ export const createAsech = /* #__PURE__ */ factory(name, dependencies, ({ typed, }, 'Array | Matrix': function (x) { - return deepMap(x, asech) + return deepMap(x, this) } }) - - return asech }) diff --git a/src/function/trigonometry/asin.js b/src/function/trigonometry/asin.js index 7fb871748b..5958096ace 100644 --- a/src/function/trigonometry/asin.js +++ b/src/function/trigonometry/asin.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' const name = 'asin' const dependencies = ['typed', 'config', 'Complex'] @@ -28,7 +28,7 @@ export const createAsin = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | BigNumber | Complex | Array | Matrix} x Function input * @return {number | BigNumber | Complex | Array | Matrix} The arc sine of x */ - const asin = typed(name, { + return typed(name, { number: function (x) { if ((x >= -1 && x <= 1) || config.predictable) { return Math.asin(x) @@ -47,9 +47,7 @@ export const createAsin = /* #__PURE__ */ factory(name, dependencies, ({ typed, 'Array | Matrix': function (x) { // deep map collection, skip zeros since asin(0) = 0 - return deepMap(x, asin, true) + return deepMap(x, this, true) } }) - - return asin }) diff --git a/src/function/trigonometry/asinh.js b/src/function/trigonometry/asinh.js index 5bb34449d0..3cb41cc891 100644 --- a/src/function/trigonometry/asinh.js +++ b/src/function/trigonometry/asinh.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { asinhNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { asinhNumber } from '../../plain/number/index.js' const name = 'asinh' const dependencies = ['typed'] @@ -27,7 +27,7 @@ export const createAsinh = /* #__PURE__ */ factory(name, dependencies, ({ typed * @param {number | Complex | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} Hyperbolic arcsine of x */ - const asinh = typed('asinh', { + return typed('asinh', { number: asinhNumber, Complex: function (x) { @@ -40,9 +40,7 @@ export const createAsinh = /* #__PURE__ */ factory(name, dependencies, ({ typed 'Array | Matrix': function (x) { // deep map collection, skip zeros since asinh(0) = 0 - return deepMap(x, asinh, true) + return deepMap(x, this, true) } }) - - return asinh }) diff --git a/src/function/trigonometry/atan.js b/src/function/trigonometry/atan.js index d1fc80b10b..27954b67a1 100644 --- a/src/function/trigonometry/atan.js +++ b/src/function/trigonometry/atan.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' const name = 'atan' const dependencies = ['typed'] @@ -28,7 +28,7 @@ export const createAtan = /* #__PURE__ */ factory(name, dependencies, ({ typed } * @param {number | BigNumber | Complex | Array | Matrix} x Function input * @return {number | BigNumber | Complex | Array | Matrix} The arc tangent of x */ - const atan = typed('atan', { + return typed('atan', { number: function (x) { return Math.atan(x) }, @@ -43,9 +43,7 @@ export const createAtan = /* #__PURE__ */ factory(name, dependencies, ({ typed } 'Array | Matrix': function (x) { // deep map collection, skip zeros since atan(0) = 0 - return deepMap(x, atan, true) + return deepMap(x, this, true) } }) - - return atan }) diff --git a/src/function/trigonometry/atan2.js b/src/function/trigonometry/atan2.js index 8e4d12cbf8..3ab817d882 100644 --- a/src/function/trigonometry/atan2.js +++ b/src/function/trigonometry/atan2.js @@ -1,11 +1,11 @@ -import { factory } from '../../utils/factory' -import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02' -import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' -import { createAlgorithm09 } from '../../type/matrix/utils/algorithm09' -import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11' -import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' +import { factory } from '../../utils/factory.js' +import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02.js' +import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js' +import { createAlgorithm09 } from '../../type/matrix/utils/algorithm09.js' +import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js' +import { createAlgorithm12 } from '../../type/matrix/utils/algorithm12.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' const name = 'atan2' const dependencies = [ @@ -54,7 +54,7 @@ export const createAtan2 = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | Array | Matrix} x First dimension * @return {number | Array | Matrix} Four-quadrant inverse tangent */ - const atan2 = typed(name, { + return typed(name, { 'number, number': Math.atan2, @@ -67,60 +67,58 @@ export const createAtan2 = /* #__PURE__ */ factory(name, dependencies, ({ typed, }, 'SparseMatrix, SparseMatrix': function (x, y) { - return algorithm09(x, y, atan2, false) + return algorithm09(x, y, this, false) }, 'SparseMatrix, DenseMatrix': function (x, y) { // mind the order of y and x! - return algorithm02(y, x, atan2, true) + return algorithm02(y, x, this, true) }, 'DenseMatrix, SparseMatrix': function (x, y) { - return algorithm03(x, y, atan2, false) + return algorithm03(x, y, this, false) }, 'DenseMatrix, DenseMatrix': function (x, y) { - return algorithm13(x, y, atan2) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { - return atan2(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { - return atan2(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { - return atan2(x, matrix(y)) + return this(x, matrix(y)) }, 'SparseMatrix, number | BigNumber': function (x, y) { - return algorithm11(x, y, atan2, false) + return algorithm11(x, y, this, false) }, 'DenseMatrix, number | BigNumber': function (x, y) { - return algorithm14(x, y, atan2, false) + return algorithm14(x, y, this, false) }, 'number | BigNumber, SparseMatrix': function (x, y) { // mind the order of y and x - return algorithm12(y, x, atan2, true) + return algorithm12(y, x, this, true) }, 'number | BigNumber, DenseMatrix': function (x, y) { // mind the order of y and x - return algorithm14(y, x, atan2, true) + return algorithm14(y, x, this, true) }, 'Array, number | BigNumber': function (x, y) { - return algorithm14(matrix(x), y, atan2, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'number | BigNumber, Array': function (x, y) { - return algorithm14(matrix(y), x, atan2, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return atan2 }) diff --git a/src/function/trigonometry/atanh.js b/src/function/trigonometry/atanh.js index 7100322e59..b4b9c4cfee 100644 --- a/src/function/trigonometry/atanh.js +++ b/src/function/trigonometry/atanh.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { atanhNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { atanhNumber } from '../../plain/number/index.js' const name = 'atanh' const dependencies = ['typed', 'config', 'Complex'] @@ -27,7 +27,7 @@ export const createAtanh = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | Complex | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} Hyperbolic arctangent of x */ - const atanh = typed(name, { + return typed(name, { number: function (x) { if ((x <= 1 && x >= -1) || config.predictable) { return atanhNumber(x) @@ -45,9 +45,7 @@ export const createAtanh = /* #__PURE__ */ factory(name, dependencies, ({ typed, 'Array | Matrix': function (x) { // deep map collection, skip zeros since atanh(0) = 0 - return deepMap(x, atanh, true) + return deepMap(x, this, true) } }) - - return atanh }) diff --git a/src/function/trigonometry/cos.js b/src/function/trigonometry/cos.js index 1e1b8577a3..4f30a5c2a0 100644 --- a/src/function/trigonometry/cos.js +++ b/src/function/trigonometry/cos.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' const name = 'cos' const dependencies = ['typed'] @@ -31,7 +31,7 @@ export const createCos = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @param {number | BigNumber | Complex | Unit | Array | Matrix} x Function input * @return {number | BigNumber | Complex | Array | Matrix} Cosine of x */ - const cos = typed(name, { + return typed(name, { number: Math.cos, Complex: function (x) { @@ -46,13 +46,11 @@ export const createCos = /* #__PURE__ */ factory(name, dependencies, ({ typed }) if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function cos is no angle') } - return cos(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { - return deepMap(x, cos) + return deepMap(x, this) } }) - - return cos }) diff --git a/src/function/trigonometry/cosh.js b/src/function/trigonometry/cosh.js index 83f9308835..3bcd921b93 100644 --- a/src/function/trigonometry/cosh.js +++ b/src/function/trigonometry/cosh.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { cosh as coshNumber } from '../../utils/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { cosh as coshNumber } from '../../utils/number.js' const name = 'cosh' const dependencies = ['typed'] @@ -27,7 +27,7 @@ export const createCosh = /* #__PURE__ */ factory(name, dependencies, ({ typed } * @param {number | BigNumber | Complex | Unit | Array | Matrix} x Function input * @return {number | BigNumber | Complex | Array | Matrix} Hyperbolic cosine of x */ - const cosh = typed(name, { + return typed(name, { number: coshNumber, Complex: function (x) { @@ -42,13 +42,11 @@ export const createCosh = /* #__PURE__ */ factory(name, dependencies, ({ typed } if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function cosh is no angle') } - return cosh(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { - return deepMap(x, cosh) + return deepMap(x, this) } }) - - return cosh }) diff --git a/src/function/trigonometry/cot.js b/src/function/trigonometry/cot.js index 29cf7cc38e..64f544a953 100644 --- a/src/function/trigonometry/cot.js +++ b/src/function/trigonometry/cot.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { cotNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { cotNumber } from '../../plain/number/index.js' const name = 'cot' const dependencies = ['typed', 'BigNumber'] @@ -27,7 +27,7 @@ export const createCot = /* #__PURE__ */ factory(name, dependencies, ({ typed, B * @param {number | Complex | Unit | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} Cotangent of x */ - const cot = typed(name, { + return typed(name, { number: cotNumber, Complex: function (x) { @@ -42,13 +42,11 @@ export const createCot = /* #__PURE__ */ factory(name, dependencies, ({ typed, B if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function cot is no angle') } - return cot(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { - return deepMap(x, cot) + return deepMap(x, this) } }) - - return cot }) diff --git a/src/function/trigonometry/coth.js b/src/function/trigonometry/coth.js index 61511f182d..68b9b9bc3a 100644 --- a/src/function/trigonometry/coth.js +++ b/src/function/trigonometry/coth.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { cothNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { cothNumber } from '../../plain/number/index.js' const name = 'coth' const dependencies = ['typed', 'BigNumber'] @@ -29,7 +29,7 @@ export const createCoth = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | Complex | Unit | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} Hyperbolic cotangent of x */ - const coth = typed(name, { + return typed(name, { number: cothNumber, Complex: function (x) { @@ -44,13 +44,11 @@ export const createCoth = /* #__PURE__ */ factory(name, dependencies, ({ typed, if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function coth is no angle') } - return coth(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { - return deepMap(x, coth) + return deepMap(x, this) } }) - - return coth }) diff --git a/src/function/trigonometry/csc.js b/src/function/trigonometry/csc.js index ac40600222..b29da96870 100644 --- a/src/function/trigonometry/csc.js +++ b/src/function/trigonometry/csc.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { cscNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { cscNumber } from '../../plain/number/index.js' const name = 'csc' const dependencies = ['typed', 'BigNumber'] @@ -27,7 +27,7 @@ export const createCsc = /* #__PURE__ */ factory(name, dependencies, ({ typed, B * @param {number | Complex | Unit | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} Cosecant of x */ - const csc = typed(name, { + return typed(name, { number: cscNumber, Complex: function (x) { @@ -42,13 +42,11 @@ export const createCsc = /* #__PURE__ */ factory(name, dependencies, ({ typed, B if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function csc is no angle') } - return csc(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { - return deepMap(x, csc) + return deepMap(x, this) } }) - - return csc }) diff --git a/src/function/trigonometry/csch.js b/src/function/trigonometry/csch.js index 2fd656d81e..f13c33faf6 100644 --- a/src/function/trigonometry/csch.js +++ b/src/function/trigonometry/csch.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { cschNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { cschNumber } from '../../plain/number/index.js' const name = 'csch' const dependencies = ['typed', 'BigNumber'] @@ -29,7 +29,7 @@ export const createCsch = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | Complex | Unit | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} Hyperbolic cosecant of x */ - const csch = typed(name, { + return typed(name, { number: cschNumber, Complex: function (x) { @@ -44,13 +44,11 @@ export const createCsch = /* #__PURE__ */ factory(name, dependencies, ({ typed, if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function csch is no angle') } - return csch(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { - return deepMap(x, csch) + return deepMap(x, this) } }) - - return csch }) diff --git a/src/function/trigonometry/index.js b/src/function/trigonometry/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/trigonometry/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/trigonometry/sec.js b/src/function/trigonometry/sec.js index 6172b43a36..d501854574 100644 --- a/src/function/trigonometry/sec.js +++ b/src/function/trigonometry/sec.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { secNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { secNumber } from '../../plain/number/index.js' const name = 'sec' const dependencies = ['typed', 'BigNumber'] @@ -27,7 +27,7 @@ export const createSec = /* #__PURE__ */ factory(name, dependencies, ({ typed, B * @param {number | Complex | Unit | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} Secant of x */ - const sec = typed(name, { + return typed(name, { number: secNumber, Complex: function (x) { @@ -42,13 +42,11 @@ export const createSec = /* #__PURE__ */ factory(name, dependencies, ({ typed, B if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function sec is no angle') } - return sec(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { - return deepMap(x, sec) + return deepMap(x, this) } }) - - return sec }) diff --git a/src/function/trigonometry/sech.js b/src/function/trigonometry/sech.js index 68ca3d2e15..49f4105566 100644 --- a/src/function/trigonometry/sech.js +++ b/src/function/trigonometry/sech.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { sechNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { sechNumber } from '../../plain/number/index.js' const name = 'sech' const dependencies = ['typed', 'BigNumber'] @@ -29,7 +29,7 @@ export const createSech = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @param {number | Complex | Unit | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} Hyperbolic secant of x */ - const sech = typed(name, { + return typed(name, { number: sechNumber, Complex: function (x) { @@ -44,13 +44,11 @@ export const createSech = /* #__PURE__ */ factory(name, dependencies, ({ typed, if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function sech is no angle') } - return sech(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { - return deepMap(x, sech) + return deepMap(x, this) } }) - - return sech }) diff --git a/src/function/trigonometry/sin.js b/src/function/trigonometry/sin.js index 23efb5e4de..a4efde3f8c 100644 --- a/src/function/trigonometry/sin.js +++ b/src/function/trigonometry/sin.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' const name = 'sin' const dependencies = ['typed'] @@ -31,7 +31,7 @@ export const createSin = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @param {number | BigNumber | Complex | Unit | Array | Matrix} x Function input * @return {number | BigNumber | Complex | Array | Matrix} Sine of x */ - const sin = typed(name, { + return typed(name, { number: Math.sin, Complex: function (x) { @@ -46,14 +46,12 @@ export const createSin = /* #__PURE__ */ factory(name, dependencies, ({ typed }) if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function sin is no angle') } - return sin(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { // deep map collection, skip zeros since sin(0) = 0 - return deepMap(x, sin, true) + return deepMap(x, this, true) } }) - - return sin }) diff --git a/src/function/trigonometry/sinh.js b/src/function/trigonometry/sinh.js index b7b5951358..db2652f2eb 100644 --- a/src/function/trigonometry/sinh.js +++ b/src/function/trigonometry/sinh.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { sinhNumber } from '../../plain/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { sinhNumber } from '../../plain/number/index.js' const name = 'sinh' const dependencies = ['typed'] @@ -27,7 +27,7 @@ export const createSinh = /* #__PURE__ */ factory(name, dependencies, ({ typed } * @param {number | BigNumber | Complex | Unit | Array | Matrix} x Function input * @return {number | BigNumber | Complex | Array | Matrix} Hyperbolic sine of x */ - const sinh = typed(name, { + return typed(name, { number: sinhNumber, Complex: function (x) { @@ -42,14 +42,12 @@ export const createSinh = /* #__PURE__ */ factory(name, dependencies, ({ typed } if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function sinh is no angle') } - return sinh(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { // deep map collection, skip zeros since sinh(0) = 0 - return deepMap(x, sinh, true) + return deepMap(x, this, true) } }) - - return sinh }) diff --git a/src/function/trigonometry/tan.js b/src/function/trigonometry/tan.js index 9b757b8d00..aa1bc9e2d4 100644 --- a/src/function/trigonometry/tan.js +++ b/src/function/trigonometry/tan.js @@ -1,5 +1,5 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' const name = 'tan' const dependencies = ['typed'] @@ -28,7 +28,7 @@ export const createTan = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @param {number | BigNumber | Complex | Unit | Array | Matrix} x Function input * @return {number | BigNumber | Complex | Array | Matrix} Tangent of x */ - const tan = typed(name, { + return typed(name, { number: Math.tan, Complex: function (x) { @@ -43,14 +43,12 @@ export const createTan = /* #__PURE__ */ factory(name, dependencies, ({ typed }) if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function tan is no angle') } - return tan(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { // deep map collection, skip zeros since tan(0) = 0 - return deepMap(x, tan, true) + return deepMap(x, this, true) } }) - - return tan }) diff --git a/src/function/trigonometry/tanh.js b/src/function/trigonometry/tanh.js index 08c4e439ed..6b51a9e96c 100644 --- a/src/function/trigonometry/tanh.js +++ b/src/function/trigonometry/tanh.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { deepMap } from '../../utils/collection' -import { tanh as _tanh } from '../../utils/number' +import { factory } from '../../utils/factory.js' +import { deepMap } from '../../utils/collection.js' +import { tanh as _tanh } from '../../utils/number.js' const name = 'tanh' const dependencies = ['typed'] @@ -30,7 +30,7 @@ export const createTanh = /* #__PURE__ */ factory(name, dependencies, ({ typed } * @param {number | BigNumber | Complex | Unit | Array | Matrix} x Function input * @return {number | BigNumber | Complex | Array | Matrix} Hyperbolic tangent of x */ - const tanh = typed('tanh', { + return typed('tanh', { number: _tanh, Complex: function (x) { @@ -45,14 +45,12 @@ export const createTanh = /* #__PURE__ */ factory(name, dependencies, ({ typed } if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function tanh is no angle') } - return tanh(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { // deep map collection, skip zeros since tanh(0) = 0 - return deepMap(x, tanh, true) + return deepMap(x, this, true) } }) - - return tanh }) diff --git a/src/function/unit/index.js b/src/function/unit/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/unit/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/unit/to.js b/src/function/unit/to.js index ac98a70463..6f30e78c47 100644 --- a/src/function/unit/to.js +++ b/src/function/unit/to.js @@ -1,6 +1,6 @@ -import { factory } from '../../utils/factory' -import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13' -import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14' +import { factory } from '../../utils/factory.js' +import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js' +import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js' const name = 'to' const dependencies = [ @@ -36,52 +36,49 @@ export const createTo = /* #__PURE__ */ factory(name, dependencies, ({ typed, ma * or a unit without value. * @return {Unit | Array | Matrix} value with changed, fixed unit. */ - const to = typed(name, { - + return typed(name, { 'Unit, Unit | string': function (x, unit) { return x.to(unit) }, 'Matrix, Matrix': function (x, y) { // SparseMatrix does not support Units - return algorithm13(x, y, to) + return algorithm13(x, y, this) }, 'Array, Array': function (x, y) { // use matrix implementation - return to(matrix(x), matrix(y)).valueOf() + return this(matrix(x), matrix(y)).valueOf() }, 'Array, Matrix': function (x, y) { // use matrix implementation - return to(matrix(x), y) + return this(matrix(x), y) }, 'Matrix, Array': function (x, y) { // use matrix implementation - return to(x, matrix(y)) + return this(x, matrix(y)) }, 'Matrix, any': function (x, y) { // SparseMatrix does not support Units - return algorithm14(x, y, to, false) + return algorithm14(x, y, this, false) }, 'any, Matrix': function (x, y) { // SparseMatrix does not support Units - return algorithm14(y, x, to, true) + return algorithm14(y, x, this, true) }, 'Array, any': function (x, y) { // use matrix implementation - return algorithm14(matrix(x), y, to, false).valueOf() + return algorithm14(matrix(x), y, this, false).valueOf() }, 'any, Array': function (x, y) { // use matrix implementation - return algorithm14(matrix(y), x, to, true).valueOf() + return algorithm14(matrix(y), x, this, true).valueOf() } }) - - return to }) diff --git a/src/function/utils/clone.js b/src/function/utils/clone.js index f0b29afd6b..61e162a680 100644 --- a/src/function/utils/clone.js +++ b/src/function/utils/clone.js @@ -1,5 +1,5 @@ -import { clone as objectClone } from '../../utils/object' -import { factory } from '../../utils/factory' +import { clone as objectClone } from '../../utils/object.js' +import { factory } from '../../utils/factory.js' const name = 'clone' const dependencies = ['typed'] diff --git a/src/function/utils/hasNumericValue.js b/src/function/utils/hasNumericValue.js index fdd9db9b13..c418aaaa79 100644 --- a/src/function/utils/hasNumericValue.js +++ b/src/function/utils/hasNumericValue.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'hasNumericValue' const dependencies = ['typed', 'isNumeric'] diff --git a/src/function/utils/index.js b/src/function/utils/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/function/utils/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/function/utils/isInteger.js b/src/function/utils/isInteger.js index 36dc9f6fbf..c822936a22 100644 --- a/src/function/utils/isInteger.js +++ b/src/function/utils/isInteger.js @@ -1,6 +1,6 @@ -import { deepMap } from '../../utils/collection' -import { isInteger as isIntegerNumber } from '../../utils/number' -import { factory } from '../../utils/factory' +import { deepMap } from '../../utils/collection.js' +import { isInteger as isIntegerNumber } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' const name = 'isInteger' const dependencies = ['typed'] @@ -35,7 +35,7 @@ export const createIsInteger = /* #__PURE__ */ factory(name, dependencies, ({ ty * @return {boolean} Returns true when `x` contains a numeric, integer value. * Throws an error in case of an unknown data type. */ - const isInteger = typed(name, { + return typed(name, { number: isIntegerNumber, // TODO: what to do with isInteger(add(0.1, 0.2)) ? BigNumber: function (x) { @@ -47,9 +47,7 @@ export const createIsInteger = /* #__PURE__ */ factory(name, dependencies, ({ ty }, 'Array | Matrix': function (x) { - return deepMap(x, isInteger) + return deepMap(x, this) } }) - - return isInteger }) diff --git a/src/function/utils/isNaN.js b/src/function/utils/isNaN.js index 85abf0e63e..909578fe33 100644 --- a/src/function/utils/isNaN.js +++ b/src/function/utils/isNaN.js @@ -1,6 +1,6 @@ -import { deepMap } from '../../utils/collection' -import { factory } from '../../utils/factory' -import { isNaNNumber } from '../../plain/number' +import { deepMap } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' +import { isNaNNumber } from '../../plain/number/index.js' const name = 'isNaN' const dependencies = ['typed'] diff --git a/src/function/utils/isNegative.js b/src/function/utils/isNegative.js index 62ac59d167..89a8925b7a 100644 --- a/src/function/utils/isNegative.js +++ b/src/function/utils/isNegative.js @@ -1,6 +1,6 @@ -import { deepMap } from '../../utils/collection' -import { factory } from '../../utils/factory' -import { isNegativeNumber } from '../../plain/number' +import { deepMap } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' +import { isNegativeNumber } from '../../plain/number/index.js' const name = 'isNegative' const dependencies = ['typed'] @@ -35,7 +35,7 @@ export const createIsNegative = /* #__PURE__ */ factory(name, dependencies, ({ t * @return {boolean} Returns true when `x` is larger than zero. * Throws an error in case of an unknown data type. */ - const isNegative = typed(name, { + return typed(name, { number: isNegativeNumber, BigNumber: function (x) { @@ -47,13 +47,11 @@ export const createIsNegative = /* #__PURE__ */ factory(name, dependencies, ({ t }, Unit: function (x) { - return isNegative(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { - return deepMap(x, isNegative) + return deepMap(x, this) } }) - - return isNegative }) diff --git a/src/function/utils/isNumeric.js b/src/function/utils/isNumeric.js index 5a21fbf89a..fa93ae7647 100644 --- a/src/function/utils/isNumeric.js +++ b/src/function/utils/isNumeric.js @@ -1,5 +1,5 @@ -import { deepMap } from '../../utils/collection' -import { factory } from '../../utils/factory' +import { deepMap } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' const name = 'isNumeric' const dependencies = ['typed'] @@ -34,7 +34,7 @@ export const createIsNumeric = /* #__PURE__ */ factory(name, dependencies, ({ ty * `Fraction`, or `boolean`. Returns false for other types. * Throws an error in case of unknown types. */ - const isNumeric = typed(name, { + return typed(name, { 'number | BigNumber | Fraction | boolean': function () { return true }, @@ -44,9 +44,7 @@ export const createIsNumeric = /* #__PURE__ */ factory(name, dependencies, ({ ty }, 'Array | Matrix': function (x) { - return deepMap(x, isNumeric) + return deepMap(x, this) } }) - - return isNumeric }) diff --git a/src/function/utils/isPositive.js b/src/function/utils/isPositive.js index 086cc394c3..bb66dcdf88 100644 --- a/src/function/utils/isPositive.js +++ b/src/function/utils/isPositive.js @@ -1,6 +1,6 @@ -import { deepMap } from '../../utils/collection' -import { factory } from '../../utils/factory' -import { isPositiveNumber } from '../../plain/number' +import { deepMap } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' +import { isPositiveNumber } from '../../plain/number/index.js' const name = 'isPositive' const dependencies = ['typed'] @@ -37,7 +37,7 @@ export const createIsPositive = /* #__PURE__ */ factory(name, dependencies, ({ t * @return {boolean} Returns true when `x` is larger than zero. * Throws an error in case of an unknown data type. */ - const isPositive = typed(name, { + return typed(name, { number: isPositiveNumber, BigNumber: function (x) { @@ -49,13 +49,11 @@ export const createIsPositive = /* #__PURE__ */ factory(name, dependencies, ({ t }, Unit: function (x) { - return isPositive(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { - return deepMap(x, isPositive) + return deepMap(x, this) } }) - - return isPositive }) diff --git a/src/function/utils/isPrime.js b/src/function/utils/isPrime.js index da112e3b68..bffe2ca102 100644 --- a/src/function/utils/isPrime.js +++ b/src/function/utils/isPrime.js @@ -1,5 +1,5 @@ -import { deepMap } from '../../utils/collection' -import { factory } from '../../utils/factory' +import { deepMap } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' const name = 'isPrime' const dependencies = ['typed'] @@ -33,7 +33,7 @@ export const createIsPrime = /* #__PURE__ */ factory(name, dependencies, ({ type * @return {boolean} Returns true when `x` is larger than zero. * Throws an error in case of an unknown data type. */ - const isPrime = typed(name, { + return typed(name, { number: function (x) { if (x * 0 !== 0) { return false @@ -69,9 +69,7 @@ export const createIsPrime = /* #__PURE__ */ factory(name, dependencies, ({ type }, 'Array | Matrix': function (x) { - return deepMap(x, isPrime) + return deepMap(x, this) } }) - - return isPrime }) diff --git a/src/function/utils/isZero.js b/src/function/utils/isZero.js index 57843c1c16..1841c53984 100644 --- a/src/function/utils/isZero.js +++ b/src/function/utils/isZero.js @@ -1,6 +1,6 @@ -import { deepMap } from '../../utils/collection' -import { factory } from '../../utils/factory' -import { isZeroNumber } from '../../plain/number' +import { deepMap } from '../../utils/collection.js' +import { factory } from '../../utils/factory.js' +import { isZeroNumber } from '../../plain/number/index.js' const name = 'isZero' const dependencies = ['typed'] @@ -39,7 +39,7 @@ export const createIsZero = /* #__PURE__ */ factory(name, dependencies, ({ typed * @return {boolean} Returns true when `x` is zero. * Throws an error in case of an unknown data type. */ - const isZero = typed(name, { + return typed(name, { number: isZeroNumber, BigNumber: function (x) { @@ -55,13 +55,11 @@ export const createIsZero = /* #__PURE__ */ factory(name, dependencies, ({ typed }, Unit: function (x) { - return isZero(x.value) + return this(x.value) }, 'Array | Matrix': function (x) { - return deepMap(x, isZero) + return deepMap(x, this) } }) - - return isZero }) diff --git a/src/function/utils/numeric.js b/src/function/utils/numeric.js index ffb6d97f12..f945dd9918 100644 --- a/src/function/utils/numeric.js +++ b/src/function/utils/numeric.js @@ -1,6 +1,6 @@ -import { typeOf } from '../../utils/is' -import { factory } from '../../utils/factory' -import { noBignumber, noFraction } from '../../utils/noop' +import { typeOf } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' +import { noBignumber, noFraction } from '../../utils/noop.js' const name = 'numeric' const dependencies = ['number', '?bignumber', '?fraction'] diff --git a/src/function/utils/typeOf.js b/src/function/utils/typeOf.js index 42b0c2a7aa..a5f434c646 100644 --- a/src/function/utils/typeOf.js +++ b/src/function/utils/typeOf.js @@ -1,6 +1,5 @@ -import { factory } from '../../utils/factory' -import { typeOf as _typeOf } from '../../utils/is' -import { warnOnce } from '../../utils/log' +import { factory } from '../../utils/factory.js' +import { typeOf as _typeOf } from '../../utils/is.js' const name = 'typeOf' const dependencies = ['typed'] @@ -68,12 +67,3 @@ export const createTypeOf = /* #__PURE__ */ factory(name, dependencies, ({ typed any: _typeOf }) }) - -// For backward compatibility, deprecated since version 6.0.0. Date: 2018-11-06 -export const createDeprecatedTypeof = /* #__PURE__ */ factory('typeof', [], () => { - return function (...args) { - warnOnce('Function "typeof" has been renamed to "typeOf" in v6.0.0, please use the new function instead.') - - return _typeOf.apply(_typeOf, args) - } -}) diff --git a/src/index.js b/src/index.js index b6517ade22..c133fdda4f 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1 @@ -// This file contains all factory functions of math.js - -import { deprecatedIndexFileError } from './error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) +export * from './entry/mainAny.js' diff --git a/src/json/index.js b/src/json/index.js deleted file mode 100644 index 54ef2a865b..0000000000 --- a/src/json/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/json/replacer.js b/src/json/replacer.js new file mode 100644 index 0000000000..2f928e449d --- /dev/null +++ b/src/json/replacer.js @@ -0,0 +1,30 @@ +import { factory } from '../utils/factory.js' + +const name = 'replacer' +const dependencies = [] + +export const createReplacer = /* #__PURE__ */ factory(name, dependencies, () => { + /** + * Stringify data types into their JSON representation. + * Most data types can be serialized using their `.toJSON` method, + * but not all, for example the number `Infinity`. For these cases you have + * to use the replacer. Example usage: + * + * JSON.stringify([2, Infinity], math.replacer) + * + * @param {string} key + * @param {*} value + * @returns {*} Returns the replaced object + */ + return function replacer (key, value) { + // the numeric values Infinitiy, -Infinity, and NaN cannot be serialized to JSON + if (typeof value === 'number' && (!isFinite(value) || isNaN(value))) { + return { + mathjs: 'number', + value: String(value) + } + } + + return value + } +}) diff --git a/src/json/reviver.js b/src/json/reviver.js index 35ec489c22..b9d57df371 100644 --- a/src/json/reviver.js +++ b/src/json/reviver.js @@ -1,4 +1,4 @@ -import { factory } from '../utils/factory' +import { factory } from '../utils/factory.js' const name = 'reviver' const dependencies = [ diff --git a/src/number.js b/src/number.js new file mode 100644 index 0000000000..7489d13711 --- /dev/null +++ b/src/number.js @@ -0,0 +1 @@ +export * from './entry/mainNumber.js' diff --git a/src/plain/bignumber/index.js b/src/plain/bignumber/index.js index 9fbb100958..9ed24155b4 100644 --- a/src/plain/bignumber/index.js +++ b/src/plain/bignumber/index.js @@ -1,6 +1,6 @@ import Decimal from 'decimal.js' -export * from './arithmetic' +export * from './arithmetic.js' // TODO: this is ugly. Instead, be able to pass your own isBigNumber function to typed? const BigNumber = Decimal.clone() diff --git a/src/plain/number/arithmetic.js b/src/plain/number/arithmetic.js index bef1b4a174..32371a0d52 100644 --- a/src/plain/number/arithmetic.js +++ b/src/plain/number/arithmetic.js @@ -1,4 +1,4 @@ -import { isInteger, log2, log10, cbrt, expm1, sign, toFixed, log1p } from '../../utils/number' +import { isInteger, log2, log10, cbrt, expm1, sign, toFixed, log1p } from '../../utils/number.js' const n1 = 'number' const n2 = 'number, number' diff --git a/src/plain/number/bitwise.js b/src/plain/number/bitwise.js index 4be522c118..356bbfe393 100644 --- a/src/plain/number/bitwise.js +++ b/src/plain/number/bitwise.js @@ -1,4 +1,4 @@ -import { isInteger } from '../../utils/number' +import { isInteger } from '../../utils/number.js' const n1 = 'number' const n2 = 'number, number' diff --git a/src/plain/number/combinations.js b/src/plain/number/combinations.js index 6b5d9e0494..f56efc7693 100644 --- a/src/plain/number/combinations.js +++ b/src/plain/number/combinations.js @@ -1,5 +1,5 @@ -import { isInteger } from '../../utils/number' -import { product } from '../../utils/product' +import { isInteger } from '../../utils/number.js' +import { product } from '../../utils/product.js' export function combinationsNumber (n, k) { if (!isInteger(n) || n < 0) { diff --git a/src/plain/number/index.js b/src/plain/number/index.js index bc96956167..69cfadce92 100644 --- a/src/plain/number/index.js +++ b/src/plain/number/index.js @@ -1,9 +1,9 @@ -export * from './arithmetic' -export * from './bitwise' -export * from './combinations' -export * from './constants' -export * from './logical' -export * from './relational' -export * from './probability' -export * from './trigonometry' -export * from './utils' +export * from './arithmetic.js' +export * from './bitwise.js' +export * from './combinations.js' +export * from './constants.js' +export * from './logical.js' +export * from './relational.js' +export * from './probability.js' +export * from './trigonometry.js' +export * from './utils.js' diff --git a/src/plain/number/probability.js b/src/plain/number/probability.js index d6032e5df7..0722293b4d 100644 --- a/src/plain/number/probability.js +++ b/src/plain/number/probability.js @@ -1,5 +1,5 @@ -import { isInteger } from '../../utils/number' -import { product } from '../../utils/product' +import { isInteger } from '../../utils/number.js' +import { product } from '../../utils/product.js' export function gammaNumber (n) { let x diff --git a/src/plain/number/trigonometry.js b/src/plain/number/trigonometry.js index 8e4115ed53..03bf6e04c7 100644 --- a/src/plain/number/trigonometry.js +++ b/src/plain/number/trigonometry.js @@ -1,4 +1,4 @@ -import { acosh, asinh, atanh, cosh, sign, sinh, tanh } from '../../utils/number' +import { acosh, asinh, atanh, cosh, sign, sinh, tanh } from '../../utils/number.js' const n1 = 'number' const n2 = 'number, number' diff --git a/src/plain/number/utils.js b/src/plain/number/utils.js index 16d654adb4..b65222ca40 100644 --- a/src/plain/number/utils.js +++ b/src/plain/number/utils.js @@ -1,4 +1,4 @@ -import { isInteger } from '../../utils/number' +import { isInteger } from '../../utils/number.js' const n1 = 'number' diff --git a/src/type/bignumber/BigNumber.js b/src/type/bignumber/BigNumber.js index b2fb8d900b..bb0c24c874 100644 --- a/src/type/bignumber/BigNumber.js +++ b/src/type/bignumber/BigNumber.js @@ -1,5 +1,5 @@ import Decimal from 'decimal.js' -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'BigNumber' const dependencies = ['?on', 'config'] diff --git a/src/type/bignumber/function/bignumber.js b/src/type/bignumber/function/bignumber.js index b39000d491..c78407d7f5 100644 --- a/src/type/bignumber/function/bignumber.js +++ b/src/type/bignumber/function/bignumber.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { deepMap } from '../../../utils/collection' +import { factory } from '../../../utils/factory.js' +import { deepMap } from '../../../utils/collection.js' const name = 'bignumber' const dependencies = ['typed', 'BigNumber'] @@ -30,7 +30,7 @@ export const createBignumber = /* #__PURE__ */ factory(name, dependencies, ({ ty * 0 by default. * @returns {BigNumber} The created bignumber */ - const bignumber = typed('bignumber', { + return typed('bignumber', { '': function () { return new BigNumber(0) }, @@ -58,9 +58,7 @@ export const createBignumber = /* #__PURE__ */ factory(name, dependencies, ({ ty }, 'Array | Matrix': function (x) { - return deepMap(x, bignumber) + return deepMap(x, this) } }) - - return bignumber }) diff --git a/src/type/bignumber/index.js b/src/type/bignumber/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/type/bignumber/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/type/boolean.js b/src/type/boolean.js index e07b9d6f06..09a52d8190 100644 --- a/src/type/boolean.js +++ b/src/type/boolean.js @@ -1,5 +1,5 @@ -import { factory } from '../utils/factory' -import { deepMap } from '../utils/collection' +import { factory } from '../utils/factory.js' +import { deepMap } from '../utils/collection.js' const name = 'boolean' const dependencies = ['typed'] @@ -32,7 +32,7 @@ export const createBoolean = /* #__PURE__ */ factory(name, dependencies, ({ type * @param {string | number | boolean | Array | Matrix | null} value A value of any type * @return {boolean | Array | Matrix} The boolean value */ - const bool = typed(name, { + return typed(name, { '': function () { return false }, @@ -72,9 +72,7 @@ export const createBoolean = /* #__PURE__ */ factory(name, dependencies, ({ type }, 'Array | Matrix': function (x) { - return deepMap(x, bool) + return deepMap(x, this) } }) - - return bool }) diff --git a/src/type/chain/Chain.js b/src/type/chain/Chain.js index 0e396bb6c8..351252a4a5 100644 --- a/src/type/chain/Chain.js +++ b/src/type/chain/Chain.js @@ -1,7 +1,7 @@ -import { isChain } from '../../utils/is' -import { format } from '../../utils/string' -import { hasOwnProperty, lazy } from '../../utils/object' -import { factory } from '../../utils/factory' +import { isChain } from '../../utils/is.js' +import { format } from '../../utils/string.js' +import { hasOwnProperty, lazy } from '../../utils/object.js' +import { factory } from '../../utils/factory.js' const name = 'Chain' const dependencies = ['?on', 'math'] diff --git a/src/type/chain/function/chain.js b/src/type/chain/function/chain.js index fffb9bd17f..9d33a149ab 100644 --- a/src/type/chain/function/chain.js +++ b/src/type/chain/function/chain.js @@ -1,4 +1,4 @@ -import { factory } from '../../../utils/factory' +import { factory } from '../../../utils/factory.js' const name = 'chain' const dependencies = ['typed', 'Chain'] diff --git a/src/type/chain/index.js b/src/type/chain/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/type/chain/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/type/complex/Complex.js b/src/type/complex/Complex.js index 48d142a3b2..22f27c783d 100644 --- a/src/type/complex/Complex.js +++ b/src/type/complex/Complex.js @@ -1,7 +1,7 @@ import Complex from 'complex.js' -import { format } from '../../utils/number' -import { isNumber, isUnit } from '../../utils/is' -import { factory } from '../../utils/factory' +import { format } from '../../utils/number.js' +import { isNumber, isUnit } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' const name = 'Complex' const dependencies = [] diff --git a/src/type/complex/function/complex.js b/src/type/complex/function/complex.js index bf39235f3a..f3e8122f31 100644 --- a/src/type/complex/function/complex.js +++ b/src/type/complex/function/complex.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { deepMap } from '../../../utils/collection' +import { factory } from '../../../utils/factory.js' +import { deepMap } from '../../../utils/collection.js' const name = 'complex' const dependencies = ['typed', 'Complex'] @@ -43,7 +43,7 @@ export const createComplex = /* #__PURE__ */ factory(name, dependencies, ({ type * Arguments specifying the real and imaginary part of the complex number * @return {Complex | Array | Matrix} Returns a complex value */ - const complex = typed('complex', { + return typed('complex', { '': function () { return Complex.ZERO }, @@ -90,9 +90,7 @@ export const createComplex = /* #__PURE__ */ factory(name, dependencies, ({ type }, 'Array | Matrix': function (x) { - return deepMap(x, complex) + return deepMap(x, this) } }) - - return complex }) diff --git a/src/type/complex/index.js b/src/type/complex/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/type/complex/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/type/fraction/Fraction.js b/src/type/fraction/Fraction.js index 8ff2ec361a..2fc580c639 100644 --- a/src/type/fraction/Fraction.js +++ b/src/type/fraction/Fraction.js @@ -1,5 +1,5 @@ import Fraction from 'fraction.js' -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'Fraction' const dependencies = [] diff --git a/src/type/fraction/function/fraction.js b/src/type/fraction/function/fraction.js index 6d3c9c8599..2d62f51469 100644 --- a/src/type/fraction/function/fraction.js +++ b/src/type/fraction/function/fraction.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { deepMap } from '../../../utils/collection' +import { factory } from '../../../utils/factory.js' +import { deepMap } from '../../../utils/collection.js' const name = 'fraction' const dependencies = ['typed', 'Fraction'] @@ -30,7 +30,7 @@ export const createFraction = /* #__PURE__ */ factory(name, dependencies, ({ typ * the fraction * @return {Fraction | Array | Matrix} Returns a fraction */ - const fraction = typed('fraction', { + return typed('fraction', { number: function (x) { if (!isFinite(x) || isNaN(x)) { throw new Error(x + ' cannot be represented as a fraction') @@ -64,9 +64,7 @@ export const createFraction = /* #__PURE__ */ factory(name, dependencies, ({ typ }, 'Array | Matrix': function (x) { - return deepMap(x, fraction) + return deepMap(x, this) } }) - - return fraction }) diff --git a/src/type/fraction/index.js b/src/type/fraction/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/type/fraction/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/type/index.js b/src/type/index.js deleted file mode 100644 index 54ef2a865b..0000000000 --- a/src/type/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/type/matrix/DenseMatrix.js b/src/type/matrix/DenseMatrix.js index a553b30938..85d1cf73e0 100644 --- a/src/type/matrix/DenseMatrix.js +++ b/src/type/matrix/DenseMatrix.js @@ -1,10 +1,10 @@ -import { isArray, isBigNumber, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is' -import { arraySize, getArrayDataType, reshape, resize, unsqueeze, validate, validateIndex } from '../../utils/array' -import { format } from '../../utils/string' -import { isInteger } from '../../utils/number' -import { clone, deepStrictEqual } from '../../utils/object' -import { DimensionError } from '../../error/DimensionError' -import { factory } from '../../utils/factory' +import { isArray, isBigNumber, isCollection, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is.js' +import { arraySize, getArrayDataType, reshape, resize, unsqueeze, validate, validateIndex } from '../../utils/array.js' +import { format } from '../../utils/string.js' +import { isInteger } from '../../utils/number.js' +import { clone, deepStrictEqual } from '../../utils/object.js' +import { DimensionError } from '../../error/DimensionError.js' +import { factory } from '../../utils/factory.js' const name = 'DenseMatrix' const dependencies = [ @@ -395,7 +395,7 @@ export const createDenseMatrixClass = /* #__PURE__ */ factory(name, dependencies * `copy=true`, otherwise return the matrix itself (resize in place). * * @memberof DenseMatrix - * @param {number[]} size The new size the matrix should have. + * @param {number[] || Matrix} size The new size the matrix should have. * @param {*} [defaultValue=0] Default value, filled in on new entries. * If not provided, the matrix elements will * be filled with zeros. @@ -405,12 +405,21 @@ export const createDenseMatrixClass = /* #__PURE__ */ factory(name, dependencies */ DenseMatrix.prototype.resize = function (size, defaultValue, copy) { // validate arguments - if (!isArray(size)) { throw new TypeError('Array expected') } + if (!isCollection(size)) { + throw new TypeError('Array or Matrix expected') + } + + // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector + const sizeArray = size.valueOf().map(value => { + return Array.isArray(value) && value.length === 1 + ? value[0] + : value + }) // matrix to resize const m = copy ? this.clone() : this // resize matrix - return _resize(m, size, defaultValue) + return _resize(m, sizeArray, defaultValue) } function _resize (matrix, size, defaultValue) { diff --git a/src/type/matrix/FibonacciHeap.js b/src/type/matrix/FibonacciHeap.js index 077f10b422..663014b531 100644 --- a/src/type/matrix/FibonacciHeap.js +++ b/src/type/matrix/FibonacciHeap.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'FibonacciHeap' const dependencies = ['smaller', 'larger'] diff --git a/src/type/matrix/ImmutableDenseMatrix.js b/src/type/matrix/ImmutableDenseMatrix.js index 69d2945910..1fc6406a04 100644 --- a/src/type/matrix/ImmutableDenseMatrix.js +++ b/src/type/matrix/ImmutableDenseMatrix.js @@ -1,6 +1,6 @@ -import { isArray, isMatrix, isString, typeOf } from '../../utils/is' -import { clone } from '../../utils/object' -import { factory } from '../../utils/factory' +import { isArray, isMatrix, isString, typeOf } from '../../utils/is.js' +import { clone } from '../../utils/object.js' +import { factory } from '../../utils/factory.js' const name = 'ImmutableDenseMatrix' const dependencies = [ diff --git a/src/type/matrix/Matrix.js b/src/type/matrix/Matrix.js index 1f4f602a41..bb052f98a5 100644 --- a/src/type/matrix/Matrix.js +++ b/src/type/matrix/Matrix.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'Matrix' const dependencies = [] @@ -38,19 +38,6 @@ export const createMatrixClass = /* #__PURE__ */ factory(name, dependencies, () Matrix.prototype.type = 'Matrix' Matrix.prototype.isMatrix = true - /** - * Get the Matrix storage constructor for the given format. - * - * @param {string} format The Matrix storage format. - * - * @return {Function} The Matrix storage constructor. - */ - Matrix.storage = function (format) { - // TODO: deprecated since v6.0.0. Clean up some day - throw new Error('Matrix.storage is deprecated since v6.0.0. ' + - 'Use the factory function math.matrix instead.') - } - /** * Get the storage format used by the matrix. * diff --git a/src/type/matrix/MatrixIndex.js b/src/type/matrix/MatrixIndex.js index f38c64948d..f1b234dcf0 100644 --- a/src/type/matrix/MatrixIndex.js +++ b/src/type/matrix/MatrixIndex.js @@ -1,7 +1,7 @@ -import { isMatrix, isRange } from '../../utils/is' -import { clone } from '../../utils/object' -import { isInteger } from '../../utils/number' -import { factory } from '../../utils/factory' +import { isMatrix, isRange } from '../../utils/is.js' +import { clone } from '../../utils/object.js' +import { isInteger } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' const name = 'Index' const dependencies = ['ImmutableDenseMatrix'] diff --git a/src/type/matrix/Range.js b/src/type/matrix/Range.js index 312a3331cd..3f7d914a4f 100644 --- a/src/type/matrix/Range.js +++ b/src/type/matrix/Range.js @@ -1,6 +1,6 @@ -import { isBigNumber } from '../../utils/is' -import { format, sign } from '../../utils/number' -import { factory } from '../../utils/factory' +import { isBigNumber } from '../../utils/is.js' +import { format, sign } from '../../utils/number.js' +import { factory } from '../../utils/factory.js' const name = 'Range' const dependencies = [] diff --git a/src/type/matrix/Spa.js b/src/type/matrix/Spa.js index 8b57d05c66..3808a1dfdc 100644 --- a/src/type/matrix/Spa.js +++ b/src/type/matrix/Spa.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'Spa' const dependencies = ['addScalar', 'equalScalar', 'FibonacciHeap'] diff --git a/src/type/matrix/SparseMatrix.js b/src/type/matrix/SparseMatrix.js index 0c1bf8c998..7318e2fc8d 100644 --- a/src/type/matrix/SparseMatrix.js +++ b/src/type/matrix/SparseMatrix.js @@ -1,10 +1,10 @@ -import { isArray, isBigNumber, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is' -import { isInteger } from '../../utils/number' -import { format } from '../../utils/string' -import { clone, deepStrictEqual } from '../../utils/object' -import { arraySize, getArrayDataType, unsqueeze, validateIndex } from '../../utils/array' -import { factory } from '../../utils/factory' -import { DimensionError } from '../../error/DimensionError' +import { isArray, isBigNumber, isCollection, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is.js' +import { isInteger } from '../../utils/number.js' +import { format } from '../../utils/string.js' +import { clone, deepStrictEqual } from '../../utils/object.js' +import { arraySize, getArrayDataType, unsqueeze, validateIndex } from '../../utils/array.js' +import { factory } from '../../utils/factory.js' +import { DimensionError } from '../../error/DimensionError.js' const name = 'SparseMatrix' const dependencies = [ @@ -545,7 +545,7 @@ export const createSparseMatrixClass = /* #__PURE__ */ factory(name, dependencie * `copy=true`, otherwise return the matrix itself (resize in place). * * @memberof SparseMatrix - * @param {number[]} size The new size the matrix should have. + * @param {number[] | Matrix} size The new size the matrix should have. * @param {*} [defaultValue=0] Default value, filled in on new entries. * If not provided, the matrix elements will * be filled with zeros. @@ -555,21 +555,31 @@ export const createSparseMatrixClass = /* #__PURE__ */ factory(name, dependencie */ SparseMatrix.prototype.resize = function (size, defaultValue, copy) { // validate arguments - if (!isArray(size)) { throw new TypeError('Array expected') } - if (size.length !== 2) { throw new Error('Only two dimensions matrix are supported') } + if (!isCollection(size)) { + throw new TypeError('Array or Matrix expected') + } + + // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector + const sizeArray = size.valueOf().map(value => { + return Array.isArray(value) && value.length === 1 + ? value[0] + : value + }) + + if (sizeArray.length !== 2) { throw new Error('Only two dimensions matrix are supported') } // check sizes - size.forEach(function (value) { + sizeArray.forEach(function (value) { if (!isNumber(value) || !isInteger(value) || value < 0) { throw new TypeError('Invalid size, must contain positive integers ' + - '(size: ' + format(size) + ')') + '(size: ' + format(sizeArray) + ')') } }) // matrix to resize const m = copy ? this.clone() : this // resize matrix - return _resize(m, size[0], size[1], defaultValue) + return _resize(m, sizeArray[0], sizeArray[1], defaultValue) } function _resize (matrix, rows, columns, defaultValue) { diff --git a/src/type/matrix/function/index.js b/src/type/matrix/function/index.js index c0f9eb056e..45e50c4fc4 100644 --- a/src/type/matrix/function/index.js +++ b/src/type/matrix/function/index.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { isBigNumber, isMatrix } from '../../../utils/is' +import { factory } from '../../../utils/factory.js' +import { isBigNumber, isMatrix } from '../../../utils/is.js' const name = 'index' const dependencies = ['typed', 'Index'] diff --git a/src/type/matrix/function/matrix.js b/src/type/matrix/function/matrix.js index 9a3896c355..4e7314e762 100644 --- a/src/type/matrix/function/matrix.js +++ b/src/type/matrix/function/matrix.js @@ -1,4 +1,4 @@ -import { factory } from '../../../utils/factory' +import { factory } from '../../../utils/factory.js' const name = 'matrix' const dependencies = ['typed', 'Matrix', 'DenseMatrix', 'SparseMatrix'] diff --git a/src/type/matrix/function/sparse.js b/src/type/matrix/function/sparse.js index 5e843db44d..24c0cbf0ce 100644 --- a/src/type/matrix/function/sparse.js +++ b/src/type/matrix/function/sparse.js @@ -1,4 +1,4 @@ -import { factory } from '../../../utils/factory' +import { factory } from '../../../utils/factory.js' const name = 'sparse' const dependencies = ['typed', 'SparseMatrix'] diff --git a/src/type/matrix/index.js b/src/type/matrix/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/type/matrix/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/type/matrix/utils/algorithm01.js b/src/type/matrix/utils/algorithm01.js index 9f174f9760..36498344b4 100644 --- a/src/type/matrix/utils/algorithm01.js +++ b/src/type/matrix/utils/algorithm01.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { DimensionError } from '../../../error/DimensionError' +import { factory } from '../../../utils/factory.js' +import { DimensionError } from '../../../error/DimensionError.js' const name = 'algorithm01' const dependencies = ['typed'] diff --git a/src/type/matrix/utils/algorithm02.js b/src/type/matrix/utils/algorithm02.js index b1c10ab234..0563a0b588 100644 --- a/src/type/matrix/utils/algorithm02.js +++ b/src/type/matrix/utils/algorithm02.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { DimensionError } from '../../../error/DimensionError' +import { factory } from '../../../utils/factory.js' +import { DimensionError } from '../../../error/DimensionError.js' const name = 'algorithm02' const dependencies = ['typed', 'equalScalar'] diff --git a/src/type/matrix/utils/algorithm03.js b/src/type/matrix/utils/algorithm03.js index 736db6968d..9ff16f14c7 100644 --- a/src/type/matrix/utils/algorithm03.js +++ b/src/type/matrix/utils/algorithm03.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { DimensionError } from '../../../error/DimensionError' +import { factory } from '../../../utils/factory.js' +import { DimensionError } from '../../../error/DimensionError.js' const name = 'algorithm03' const dependencies = ['typed'] diff --git a/src/type/matrix/utils/algorithm04.js b/src/type/matrix/utils/algorithm04.js index a720693f4d..34315a391b 100644 --- a/src/type/matrix/utils/algorithm04.js +++ b/src/type/matrix/utils/algorithm04.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { DimensionError } from '../../../error/DimensionError' +import { factory } from '../../../utils/factory.js' +import { DimensionError } from '../../../error/DimensionError.js' const name = 'algorithm04' const dependencies = ['typed', 'equalScalar'] diff --git a/src/type/matrix/utils/algorithm05.js b/src/type/matrix/utils/algorithm05.js index 8201e21d45..3eeb30e954 100644 --- a/src/type/matrix/utils/algorithm05.js +++ b/src/type/matrix/utils/algorithm05.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { DimensionError } from '../../../error/DimensionError' +import { factory } from '../../../utils/factory.js' +import { DimensionError } from '../../../error/DimensionError.js' const name = 'algorithm05' const dependencies = ['typed', 'equalScalar'] diff --git a/src/type/matrix/utils/algorithm06.js b/src/type/matrix/utils/algorithm06.js index eafe5b9ddb..8510c393ce 100644 --- a/src/type/matrix/utils/algorithm06.js +++ b/src/type/matrix/utils/algorithm06.js @@ -1,6 +1,6 @@ -import { factory } from '../../../utils/factory' -import { DimensionError } from '../../../error/DimensionError' -import { scatter } from '../../../utils/collection' +import { factory } from '../../../utils/factory.js' +import { DimensionError } from '../../../error/DimensionError.js' +import { scatter } from '../../../utils/collection.js' const name = 'algorithm06' const dependencies = ['typed', 'equalScalar'] diff --git a/src/type/matrix/utils/algorithm07.js b/src/type/matrix/utils/algorithm07.js index 7e1cac706e..a25530dd8d 100644 --- a/src/type/matrix/utils/algorithm07.js +++ b/src/type/matrix/utils/algorithm07.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { DimensionError } from '../../../error/DimensionError' +import { factory } from '../../../utils/factory.js' +import { DimensionError } from '../../../error/DimensionError.js' const name = 'algorithm07' const dependencies = ['typed', 'DenseMatrix'] diff --git a/src/type/matrix/utils/algorithm08.js b/src/type/matrix/utils/algorithm08.js index dec55fd296..7a8d8c2d02 100644 --- a/src/type/matrix/utils/algorithm08.js +++ b/src/type/matrix/utils/algorithm08.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { DimensionError } from '../../../error/DimensionError' +import { factory } from '../../../utils/factory.js' +import { DimensionError } from '../../../error/DimensionError.js' const name = 'algorithm08' const dependencies = ['typed', 'equalScalar'] diff --git a/src/type/matrix/utils/algorithm09.js b/src/type/matrix/utils/algorithm09.js index 91fcd443d9..90cf4702ff 100644 --- a/src/type/matrix/utils/algorithm09.js +++ b/src/type/matrix/utils/algorithm09.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { DimensionError } from '../../../error/DimensionError' +import { factory } from '../../../utils/factory.js' +import { DimensionError } from '../../../error/DimensionError.js' const name = 'algorithm09' const dependencies = ['typed', 'equalScalar'] diff --git a/src/type/matrix/utils/algorithm10.js b/src/type/matrix/utils/algorithm10.js index 1b6ab8f70b..0c7eeaa220 100644 --- a/src/type/matrix/utils/algorithm10.js +++ b/src/type/matrix/utils/algorithm10.js @@ -1,4 +1,4 @@ -import { factory } from '../../../utils/factory' +import { factory } from '../../../utils/factory.js' const name = 'algorithm10' const dependencies = ['typed', 'DenseMatrix'] diff --git a/src/type/matrix/utils/algorithm11.js b/src/type/matrix/utils/algorithm11.js index 34a74c34dc..a79cead99c 100644 --- a/src/type/matrix/utils/algorithm11.js +++ b/src/type/matrix/utils/algorithm11.js @@ -1,4 +1,4 @@ -import { factory } from '../../../utils/factory' +import { factory } from '../../../utils/factory.js' const name = 'algorithm11' const dependencies = ['typed', 'equalScalar'] diff --git a/src/type/matrix/utils/algorithm12.js b/src/type/matrix/utils/algorithm12.js index a0b6394e8e..dfa1812a85 100644 --- a/src/type/matrix/utils/algorithm12.js +++ b/src/type/matrix/utils/algorithm12.js @@ -1,4 +1,4 @@ -import { factory } from '../../../utils/factory' +import { factory } from '../../../utils/factory.js' const name = 'algorithm12' const dependencies = ['typed', 'DenseMatrix'] diff --git a/src/type/matrix/utils/algorithm13.js b/src/type/matrix/utils/algorithm13.js index 4ae533089f..ce1a064bd2 100644 --- a/src/type/matrix/utils/algorithm13.js +++ b/src/type/matrix/utils/algorithm13.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { DimensionError } from '../../../error/DimensionError' +import { factory } from '../../../utils/factory.js' +import { DimensionError } from '../../../error/DimensionError.js' const name = 'algorithm13' const dependencies = ['typed'] diff --git a/src/type/matrix/utils/algorithm14.js b/src/type/matrix/utils/algorithm14.js index f6c191d809..d03382b883 100644 --- a/src/type/matrix/utils/algorithm14.js +++ b/src/type/matrix/utils/algorithm14.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { clone } from '../../../utils/object' +import { factory } from '../../../utils/factory.js' +import { clone } from '../../../utils/object.js' const name = 'algorithm14' const dependencies = ['typed'] diff --git a/src/type/number.js b/src/type/number.js index e3d02f09de..52e160f8f0 100644 --- a/src/type/number.js +++ b/src/type/number.js @@ -1,5 +1,5 @@ -import { factory } from '../utils/factory' -import { deepMap } from '../utils/collection' +import { factory } from '../utils/factory.js' +import { deepMap } from '../utils/collection.js' const name = 'number' const dependencies = ['typed'] @@ -69,9 +69,18 @@ export const createNumber = /* #__PURE__ */ factory(name, dependencies, ({ typed }, 'Array | Matrix': function (x) { - return deepMap(x, number) + return deepMap(x, this) } }) + // reviver function to parse a JSON object like: + // + // {"mathjs":"number","value":"2.3"} + // + // into a number 2.3 + number.fromJSON = function (json) { + return parseFloat(json.value) + } + return number }) diff --git a/src/type/resultset/ResultSet.js b/src/type/resultset/ResultSet.js index 9663809bd5..a56be92e7a 100644 --- a/src/type/resultset/ResultSet.js +++ b/src/type/resultset/ResultSet.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' const name = 'ResultSet' const dependencies = [] diff --git a/src/type/resultset/index.js b/src/type/resultset/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/type/resultset/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/type/string.js b/src/type/string.js index e20fade452..4b35b5738c 100644 --- a/src/type/string.js +++ b/src/type/string.js @@ -1,6 +1,6 @@ -import { factory } from '../utils/factory' -import { deepMap } from '../utils/collection' -import { format } from '../utils/number' +import { factory } from '../utils/factory.js' +import { deepMap } from '../utils/collection.js' +import { format } from '../utils/number.js' const name = 'string' const dependencies = ['typed'] @@ -31,7 +31,7 @@ export const createString = /* #__PURE__ */ factory(name, dependencies, ({ typed * @param {* | Array | Matrix | null} [value] A value to convert to a string * @return {string | Array | Matrix} The created string */ - const string = typed(name, { + return typed(name, { '': function () { return '' }, @@ -51,13 +51,11 @@ export const createString = /* #__PURE__ */ factory(name, dependencies, ({ typed }, 'Array | Matrix': function (x) { - return deepMap(x, string) + return deepMap(x, this) }, any: function (x) { return String(x) } }) - - return string }) diff --git a/src/type/unit/Unit.js b/src/type/unit/Unit.js index 76f9116e07..e5781e2ef3 100644 --- a/src/type/unit/Unit.js +++ b/src/type/unit/Unit.js @@ -1,8 +1,8 @@ -import { isComplex, isUnit, typeOf } from '../../utils/is' -import { factory } from '../../utils/factory' -import { endsWith } from '../../utils/string' -import { clone, hasOwnProperty } from '../../utils/object' -import { createBigNumberPi as createPi } from '../../utils/bignumber/constants' +import { isComplex, isUnit, typeOf } from '../../utils/is.js' +import { factory } from '../../utils/factory.js' +import { endsWith } from '../../utils/string.js' +import { clone, hasOwnProperty } from '../../utils/object.js' +import { createBigNumberPi as createPi } from '../../utils/bignumber/constants.js' const name = 'Unit' const dependencies = [ @@ -218,8 +218,8 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ // Alphanumeric characters only; matches [a-zA-Z0-9] let code = text.charCodeAt(index) while ((code >= 48 && code <= 57) || - (code >= 65 && code <= 90) || - (code >= 97 && code <= 122)) { + (code >= 65 && code <= 90) || + (code >= 97 && code <= 122)) { unitName += c next() code = text.charCodeAt(index) @@ -228,7 +228,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ // Must begin with [a-zA-Z] code = unitName.charCodeAt(0) if ((code >= 65 && code <= 90) || - (code >= 97 && code <= 122)) { + (code >= 97 && code <= 122)) { return unitName || null } else { return null @@ -683,10 +683,9 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ // Append other's units list onto res for (let i = 0; i < other.units.length; i++) { - // Make a deep copy - const inverted = {} - for (const key in other.units[i]) { - inverted[key] = other.units[i][key] + // Make a shallow copy of every unit + const inverted = { + ...other.units[i] } res.units.push(inverted) } @@ -721,12 +720,11 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ // Invert and append other's units list onto res for (let i = 0; i < other.units.length; i++) { - // Make a deep copy - const inverted = {} - for (const key in other.units[i]) { - inverted[key] = other.units[i][key] + // Make a shallow copy of every unit + const inverted = { + ...other.units[i], + power: -other.units[i].power } - inverted.power = -inverted.power res.units.push(inverted) } @@ -880,7 +878,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ other = this.clone() } - if (other._isDerived()) { + if (other._isDerived() || other.units.length === 0) { return other._denormalize(other.value) } else { return other._denormalize(other.value, other.units[0].prefix.value) @@ -943,9 +941,11 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ // Search for a matching base let matchingBase for (const key in currentUnitSystem) { - if (ret.hasBase(BASE_UNITS[key])) { - matchingBase = key - break + if (hasOwnProperty(currentUnitSystem, key)) { + if (ret.hasBase(BASE_UNITS[key])) { + matchingBase = key + break + } } } @@ -1113,11 +1113,13 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ } for (const i in simp.units) { - if (simp.units[i].unit) { - if (simp.units[i].unit.name === 'VA' && isImaginary) { - simp.units[i].unit = UNITS.VAR - } else if (simp.units[i].unit.name === 'VAR' && !isImaginary) { - simp.units[i].unit = UNITS.VA + if (hasOwnProperty(simp.units, i)) { + if (simp.units[i].unit) { + if (simp.units[i].unit.name === 'VA' && isImaginary) { + simp.units[i].unit = UNITS.VAR + } else if (simp.units[i].unit.name === 'VAR' && !isImaginary) { + simp.units[i].unit = UNITS.VA + } } } } @@ -1188,7 +1190,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ Math.log(absValue / Math.pow(prefix.value * absUnitValue, power)) / Math.LN10 - 1.2) if (diff < bestDiff || - (diff === bestDiff && prefix.name.length < bestPrefix.name.length)) { + (diff === bestDiff && prefix.name.length < bestPrefix.name.length)) { // choose the prefix with the smallest diff, or if equal, choose the one // with the shortest name (can happen with SHORTLONG for example) bestPrefix = prefix @@ -1516,7 +1518,9 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ } for (const key in BASE_UNITS) { - BASE_UNITS[key].key = key + if (hasOwnProperty(BASE_UNITS, key)) { + BASE_UNITS[key].key = key + } } const BASE_UNIT_NONE = {} @@ -2957,8 +2961,10 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ */ Unit.getUnitSystem = function () { for (const key in UNIT_SYSTEMS) { - if (UNIT_SYSTEMS[key] === currentUnitSystem) { - return key + if (hasOwnProperty(UNIT_SYSTEMS, key)) { + if (UNIT_SYSTEMS[key] === currentUnitSystem) { + return key + } } } } @@ -3003,8 +3009,10 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ // Add dimensions to each built-in unit for (const key in UNITS) { - const unit = UNITS[key] - unit.dimensions = unit.base.dimensions + if (hasOwnProperty(UNITS, key)) { + const unit = UNITS[key] + unit.dimensions = unit.base.dimensions + } } // Create aliases @@ -3037,7 +3045,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ if (i === 0 && !isValidAlpha(c)) { throw new Error('Invalid unit name (must begin with alpha character): "' + name + '"') } if (i > 0 && !(isValidAlpha(c) || - isDigit(c))) { throw new Error('Invalid unit name (only alphanumeric characters are allowed): "' + name + '"') } + isDigit(c))) { throw new Error('Invalid unit name (only alphanumeric characters are allowed): "' + name + '"') } } } diff --git a/src/type/unit/function/createUnit.js b/src/type/unit/function/createUnit.js index 235e099ae6..76fa53a68c 100644 --- a/src/type/unit/function/createUnit.js +++ b/src/type/unit/function/createUnit.js @@ -1,4 +1,4 @@ -import { factory } from '../../../utils/factory' +import { factory } from '../../../utils/factory.js' const name = 'createUnit' const dependencies = ['typed', 'Unit'] diff --git a/src/type/unit/function/splitUnit.js b/src/type/unit/function/splitUnit.js index b61b3d0966..d6a787a5cf 100644 --- a/src/type/unit/function/splitUnit.js +++ b/src/type/unit/function/splitUnit.js @@ -1,4 +1,4 @@ -import { factory } from '../../../utils/factory' +import { factory } from '../../../utils/factory.js' const name = 'splitUnit' const dependencies = ['typed'] diff --git a/src/type/unit/function/unit.js b/src/type/unit/function/unit.js index 3a8308d0a7..108e643329 100644 --- a/src/type/unit/function/unit.js +++ b/src/type/unit/function/unit.js @@ -1,5 +1,5 @@ -import { factory } from '../../../utils/factory' -import { deepMap } from '../../../utils/collection' +import { factory } from '../../../utils/factory.js' +import { deepMap } from '../../../utils/collection.js' const name = 'unit' const dependencies = ['typed', 'Unit'] @@ -30,7 +30,7 @@ export const createUnitFunction = /* #__PURE__ */ factory(name, dependencies, ({ * @return {Unit | Array | Matrix} The created unit */ - const unit = typed(name, { + return typed(name, { Unit: function (x) { return x.clone() }, @@ -48,9 +48,7 @@ export const createUnitFunction = /* #__PURE__ */ factory(name, dependencies, ({ }, 'Array | Matrix': function (x) { - return deepMap(x, unit) + return deepMap(x, this) } }) - - return unit }) diff --git a/src/type/unit/index.js b/src/type/unit/index.js deleted file mode 100644 index ad4e48b482..0000000000 --- a/src/type/unit/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { deprecatedIndexFileError } from '../../error/deprecatedIndexFileError' - -deprecatedIndexFileError(__filename) diff --git a/src/type/unit/physicalConstants.js b/src/type/unit/physicalConstants.js index c539776050..cd47ea6626 100644 --- a/src/type/unit/physicalConstants.js +++ b/src/type/unit/physicalConstants.js @@ -1,4 +1,4 @@ -import { factory } from '../../utils/factory' +import { factory } from '../../utils/factory.js' // Source: https://en.wikipedia.org/wiki/Physical_constant diff --git a/src/utils/array.js b/src/utils/array.js index 2f3330a4e0..59ccb80a42 100644 --- a/src/utils/array.js +++ b/src/utils/array.js @@ -1,8 +1,8 @@ -import { isInteger } from './number' -import { isNumber } from './is' -import { format } from './string' -import { DimensionError } from '../error/DimensionError' -import { IndexError } from '../error/IndexError' +import { isInteger } from './number.js' +import { isNumber } from './is.js' +import { format } from './string.js' +import { DimensionError } from '../error/DimensionError.js' +import { IndexError } from '../error/IndexError.js' /** * Calculate the size of a multi dimensional array. diff --git a/src/utils/bignumber/constants.js b/src/utils/bignumber/constants.js index bbe9e7fac1..1d67e95cf9 100644 --- a/src/utils/bignumber/constants.js +++ b/src/utils/bignumber/constants.js @@ -1,4 +1,4 @@ -import { memoize } from '../function' +import { memoize } from '../function.js' /** * Calculate BigNumber e diff --git a/src/utils/bignumber/formatter.js b/src/utils/bignumber/formatter.js index 4f10fae20d..4c8d4d567a 100644 --- a/src/utils/bignumber/formatter.js +++ b/src/utils/bignumber/formatter.js @@ -1,5 +1,3 @@ -import { mapObject } from '../object' - /** * Convert a BigNumber to a formatted string representation. * @@ -109,27 +107,6 @@ export function format (value, options) { case 'auto': { - // TODO: clean up some day. Deprecated since: 2018-01-24 - // @deprecated upper and lower are replaced with upperExp and lowerExp since v4.0.0 - if (options && options.exponential && (options.exponential.lower !== undefined || options.exponential.upper !== undefined)) { - const fixedOptions = mapObject(options, function (x) { return x }) - fixedOptions.exponential = undefined - if (options.exponential.lower !== undefined) { - fixedOptions.lowerExp = Math.round(Math.log(options.exponential.lower) / Math.LN10) - } - if (options.exponential.upper !== undefined) { - fixedOptions.upperExp = Math.round(Math.log(options.exponential.upper) / Math.LN10) - } - - console.warn('Deprecation warning: Formatting options exponential.lower and exponential.upper ' + - '(minimum and maximum value) ' + - 'are replaced with exponential.lowerExp and exponential.upperExp ' + - '(minimum and maximum exponent) since version 4.0.0. ' + - 'Replace ' + JSON.stringify(options) + ' with ' + JSON.stringify(fixedOptions)) - - return format(value, fixedOptions) - } - // determine lower and upper bound for exponential notation. // TODO: implement support for upper and lower to be BigNumbers themselves const lowerExp = (options && options.lowerExp !== undefined) ? options.lowerExp : -3 diff --git a/src/utils/collection.js b/src/utils/collection.js index a9be960235..d5da0647a1 100644 --- a/src/utils/collection.js +++ b/src/utils/collection.js @@ -1,6 +1,6 @@ -import { isCollection, isMatrix } from './is' -import { IndexError } from '../error/IndexError' -import { arraySize } from './array' +import { isCollection, isMatrix } from './is.js' +import { IndexError } from '../error/IndexError.js' +import { arraySize } from './array.js' /** * Test whether an array contains collections diff --git a/src/utils/complex.js b/src/utils/complex.js index f9589d25ec..dae1aaa09c 100644 --- a/src/utils/complex.js +++ b/src/utils/complex.js @@ -1,4 +1,4 @@ -import { nearlyEqual } from './number' +import { nearlyEqual } from './number.js' /** * Test whether two complex values are equal provided a given epsilon. diff --git a/src/utils/customs.js b/src/utils/customs.js index c132d80f33..eaaba2cfb6 100644 --- a/src/utils/customs.js +++ b/src/utils/customs.js @@ -1,4 +1,4 @@ -import { hasOwnProperty } from './object' +import { hasOwnProperty } from './object.js' /** * Get a property of a plain object diff --git a/src/utils/factory.js b/src/utils/factory.js index 1f48c4072b..32afaa763d 100644 --- a/src/utils/factory.js +++ b/src/utils/factory.js @@ -1,5 +1,5 @@ -import { contains } from './array' -import { pickShallow } from './object' +import { contains } from './array.js' +import { pickShallow } from './object.js' /** * Create a factory function, which can be used to inject dependencies. diff --git a/src/utils/latex.js b/src/utils/latex.js index 0ab7f99e44..6f91847030 100644 --- a/src/utils/latex.js +++ b/src/utils/latex.js @@ -1,7 +1,7 @@ /* eslint no-template-curly-in-string: "off" */ import escapeLatexLib from 'escape-latex' -import { hasOwnProperty } from './object' +import { hasOwnProperty } from './object.js' export const latexSymbols = { // GREEK LETTERS diff --git a/src/utils/number.js b/src/utils/number.js index e65c03aaf6..d35fbe5307 100644 --- a/src/utils/number.js +++ b/src/utils/number.js @@ -1,5 +1,4 @@ -import { mapObject } from './object' -import { isNumber } from './is' +import { isNumber } from './is.js' /** * @typedef {{sign: '+' | '-' | '', coefficients: number[], exponent: number}} SplitValue @@ -220,27 +219,6 @@ export function format (value, options) { return toEngineering(value, precision) case 'auto': - // TODO: clean up some day. Deprecated since: 2018-01-24 - // @deprecated upper and lower are replaced with upperExp and lowerExp since v4.0.0 - if (options && options.exponential && (options.exponential.lower !== undefined || options.exponential.upper !== undefined)) { - const fixedOptions = mapObject(options, function (x) { return x }) - fixedOptions.exponential = undefined - if (options.exponential.lower !== undefined) { - fixedOptions.lowerExp = Math.round(Math.log(options.exponential.lower) / Math.LN10) - } - if (options.exponential.upper !== undefined) { - fixedOptions.upperExp = Math.round(Math.log(options.exponential.upper) / Math.LN10) - } - - console.warn('Deprecation warning: Formatting options exponential.lower and exponential.upper ' + - '(minimum and maximum value) ' + - 'are replaced with exponential.lowerExp and exponential.upperExp ' + - '(minimum and maximum exponent) since version 4.0.0. ' + - 'Replace ' + JSON.stringify(options) + ' with ' + JSON.stringify(fixedOptions)) - - return toPrecision(value, precision, fixedOptions) - } - // remove trailing zeros after the decimal point return toPrecision(value, precision, options && options) .replace(/((\.\d*?)(0+))($|e)/, function () { @@ -310,7 +288,8 @@ export function toEngineering (value, precision) { return String(value) } - const rounded = roundDigits(splitNumber(value), precision) + const split = splitNumber(value) + const rounded = roundDigits(split, precision) const e = rounded.exponent const c = rounded.coefficients @@ -325,17 +304,15 @@ export function toEngineering (value, precision) { } } else { // concatenate coefficients with necessary zeros - const significandsDiff = e >= 0 ? e : Math.abs(newExp) - - // add zeros if necessary (for ex: 1e+8) - while (c.length - 1 < significandsDiff) { + // add zeros if necessary (for example: 1e+8 -> 100e+6) + const missingZeros = Math.abs(e - newExp) - (c.length - 1) + for (let i = 0; i < missingZeros; i++) { c.push(0) } } // find difference in exponents let expDiff = Math.abs(e - newExp) - let decimalIdx = 1 // push decimal index over by expDiff times diff --git a/src/utils/object.js b/src/utils/object.js index 46cf4b3c7e..78a8118399 100644 --- a/src/utils/object.js +++ b/src/utils/object.js @@ -1,4 +1,4 @@ -import { isBigNumber } from './is' +import { isBigNumber } from './is.js' /** * Clone an object diff --git a/src/utils/snapshot.js b/src/utils/snapshot.js index 8054fd81bf..f06444fc08 100644 --- a/src/utils/snapshot.js +++ b/src/utils/snapshot.js @@ -6,9 +6,9 @@ * into ES5 code under /lib and can be used straight by node.js */ import assert from 'assert' -import * as allIsFunctions from './is' -import { create } from '../core/create' -import { endsWith } from './string' +import * as allIsFunctions from './is.js' +import { create } from '../core/create.js' +import { endsWith } from './string.js' export function validateBundle (expectedBundleStructure, bundle) { const originalWarn = console.warn @@ -145,14 +145,14 @@ export function createSnapshotFromFactories (factories) { 'apply', 'addScalar', 'multiplyScalar', - 'eye', 'print', 'divideScalar', 'parse', 'compile', 'parser', 'chain', - 'reviver' + 'reviver', + 'replacer' ]) const allTypeChecks = {} @@ -176,9 +176,6 @@ export function createSnapshotFromFactories (factories) { once: 'Function', emit: 'Function', import: 'Function', - var: 'Function', - eval: 'Function', - typeof: 'Function', config: 'Function', create: 'Function', factory: 'Function', @@ -197,35 +194,13 @@ export function createSnapshotFromFactories (factories) { 'chain' ]), config: 'Function' - }, - // deprecated stuff: - // docs: embeddedDocs, - node: { - ...allNodeClasses - }, - parse: 'Function', - Parser: 'Function' - }, - - // deprecated stuff: - type: { - ...allTypeChecks, - ...allClasses - }, - json: { - reviver: 'Function' - }, - error: { - ...allErrorClasses + } } } const expectedES6Structure = { // functions ...exclude(allFunctionsConstantsClasses, [ - 'typeof', - 'eval', - 'var', 'E', 'false', 'Infinity', @@ -237,10 +212,6 @@ export function createSnapshotFromFactories (factories) { create: 'Function', config: 'Function', factory: 'Function', - deprecatedEval: 'Function', - deprecatedImport: 'Function', - deprecatedVar: 'Function', - deprecatedTypeof: 'Function', _true: 'boolean', _false: 'boolean', _null: 'null', @@ -252,26 +223,7 @@ export function createSnapshotFromFactories (factories) { ...allDependencyCollections, ...allFactoryFunctions, - docs: embeddedDocs, - - // deprecated stuff: - expression: { - node: { - ...allNodeClasses - }, - parse: 'Function', - Parser: 'Function' - }, - type: { - ...allTypeChecks, - ...allClasses - }, - json: { - reviver: 'Function' - }, - error: { - ...allErrorClasses - } + docs: embeddedDocs } return { diff --git a/src/utils/string.js b/src/utils/string.js index 35a338bce1..0558ef29d6 100644 --- a/src/utils/string.js +++ b/src/utils/string.js @@ -1,6 +1,6 @@ -import { isBigNumber, isString, typeOf } from './is' -import { format as formatNumber } from './number' -import { format as formatBigNumber } from './bignumber/formatter' +import { isBigNumber, isString, typeOf } from './is.js' +import { format as formatNumber } from './number.js' +import { format as formatBigNumber } from './bignumber/formatter.js' /** * Check if a text ends with a certain string. diff --git a/src/version.js b/src/version.js index 502a0b4344..ed0762f703 100644 --- a/src/version.js +++ b/src/version.js @@ -1,3 +1,3 @@ -export const version = '6.6.0' +export const version = '7.1.0' // Note: This file is automatically generated when building math.js. // Changes made in this file will be overwritten. diff --git a/test/benchmark/expression_parser.js b/test/benchmark/expression_parser.js index 61e45a1676..23d431f73c 100644 --- a/test/benchmark/expression_parser.js +++ b/test/benchmark/expression_parser.js @@ -6,7 +6,7 @@ const assert = require('assert') const Benchmark = require('benchmark') const padRight = require('pad-right') const math = require('../..') -const getSafeProperty = require('../../lib/utils/customs').getSafeProperty +const getSafeProperty = require('../../lib/cjs/utils/customs').getSafeProperty // expose on window when using bundled in a browser if (typeof window !== 'undefined') { diff --git a/test/browser-test-config/browserstack-karma.js b/test/browser-test-config/browserstack-karma.js index 97e0a47a25..66e277840e 100644 --- a/test/browser-test-config/browserstack-karma.js +++ b/test/browser-test-config/browserstack-karma.js @@ -39,14 +39,14 @@ module.exports = function (config) { bs_firefox_windows: { base: 'BrowserStack', browser: 'firefox', - browser_version: '71', + browser_version: '75', os: 'Windows', os_version: '10' }, bs_chrome_mac: { base: 'BrowserStack', browser: 'Chrome', - browser_version: '78', + browser_version: '81', os: 'OS X', os_version: 'High Sierra' }, @@ -67,7 +67,7 @@ module.exports = function (config) { bs_edge: { base: 'BrowserStack', browser: 'Edge', - browser_version: '18', + browser_version: '81', os: 'Windows', os_version: '10' } diff --git a/test/generated-code-tests/entry/mainAny.test.js b/test/generated-code-tests/entry/mainAny.test.js index c64e319fb9..f3111cc0b0 100644 --- a/test/generated-code-tests/entry/mainAny.test.js +++ b/test/generated-code-tests/entry/mainAny.test.js @@ -24,17 +24,7 @@ describe('mainAny', function () { // snapshot testing const newMathInstance = create(all) - // don't output all deprecation warnings "math.foo.bar is move to math.bar, ..." - const originalWarn = console.warn - console.warn = (...args) => { - if (args.join(' ').indexOf('is moved to') === -1) { - originalWarn.apply(console, args) - } - } - validateBundle(expectedInstanceStructure, newMathInstance) - - console.warn = originalWarn }) it('new instance should import all factory functions via import', function () { @@ -43,17 +33,7 @@ describe('mainAny', function () { newMathInstance.import(all) - // don't output all deprecation warnings "math.foo.bar is move to math.bar, ..." - const originalWarn = console.warn - console.warn = (...args) => { - if (args.join(' ').indexOf('is moved to') === -1) { - originalWarn.apply(console, args) - } - } - validateBundle(expectedInstanceStructure, newMathInstance) - - console.warn = originalWarn }) it('new instance should import some factory functions via import', function () { diff --git a/test/generated-code-tests/entry/mainNumber.test.js b/test/generated-code-tests/entry/mainNumber.test.js index 39ce8c486f..3c240373b7 100644 --- a/test/generated-code-tests/entry/mainNumber.test.js +++ b/test/generated-code-tests/entry/mainNumber.test.js @@ -9,19 +9,6 @@ const { expectedES6Structure } = createSnapshotFromFactories(factoriesNumber) -// number exports don't have all deprecated stuff that the any exports have -delete expectedES6Structure.deprecatedEval -delete expectedES6Structure.deprecatedImport -delete expectedES6Structure.deprecatedVar -delete expectedES6Structure.deprecatedTypeof -delete expectedES6Structure.expression -delete expectedES6Structure.type -delete expectedES6Structure.json -delete expectedES6Structure.error -delete expectedInstanceStructure.var -delete expectedInstanceStructure.eval -delete expectedInstanceStructure.typeof - describe('mainNumber', function () { it('should export functions', () => { assert.strictEqual(add(2, 3), 5) @@ -37,17 +24,7 @@ describe('mainNumber', function () { // snapshot testing const newMathInstance = create(all) - // don't output all deprecation warnings "math.foo.bar is move to math.bar, ..." - const originalWarn = console.warn - console.warn = (...args) => { - if (args.join(' ').indexOf('is moved to') === -1) { - originalWarn.apply(console, args) - } - } - validateBundle(expectedInstanceStructure, newMathInstance) - - console.warn = originalWarn }) it('new instance should import some factory functions via import', function () { @@ -66,17 +43,7 @@ describe('mainNumber', function () { newMathInstance.import(all) - // don't output all deprecation warnings "math.foo.bar is move to math.bar, ..." - const originalWarn = console.warn - console.warn = (...args) => { - if (args.join(' ').indexOf('is moved to') === -1) { - originalWarn.apply(console, args) - } - } - validateBundle(expectedInstanceStructure, newMathInstance) - - console.warn = originalWarn }) it('new instance should import some factory functions via import', function () { diff --git a/test/node-tests/cli/cli.test.js b/test/node-tests/cli/cli.test.js index 9e0a0a5acd..b79cd71934 100644 --- a/test/node-tests/cli/cli.test.js +++ b/test/node-tests/cli/cli.test.js @@ -4,7 +4,7 @@ const path = require('path') const cp = require('child_process') function run (args, done) { - cp.exec('bin/cli.js ' + args, function (e, r) { + cp.exec('node bin/cli.js ' + args, function (e, r) { done(e, r.replace(/\n$/g, '')) }) } diff --git a/test/node-tests/dist.test.js b/test/node-tests/dist.test.js index e809a18033..b907dd2bcd 100644 --- a/test/node-tests/dist.test.js +++ b/test/node-tests/dist.test.js @@ -1,30 +1,30 @@ // Only use native node.js API's and references to ./lib here, this file is not transpiled! const assert = require('assert') -const { createSnapshotFromFactories, validateBundle } = require('../../lib/utils/snapshot') -const factoriesAny = require('../../lib/factoriesAny') +const { createSnapshotFromFactories, validateBundle } = require('../../lib/cjs/utils/snapshot') +const factoriesAny = require('../../lib/cjs/factoriesAny') const version = require('../../package.json').version -const embeddedDocs = require('../../lib/expression/embeddedDocs/embeddedDocs') +const embeddedDocs = require('../../lib/cjs/expression/embeddedDocs/embeddedDocs') const { expectedInstanceStructure } = createSnapshotFromFactories(factoriesAny) describe('dist', function () { - it('should load dist/math.js', function () { - const math = require('../../dist/math.js') + it('should load lib/browser/math.js', function () { + const math = require('../../lib/browser/math.js') assert.strictEqual(math.add(2, 3), 5) assert.strictEqual(math.version, version) }) - it('should load dist/math.min.js', function () { - const math = require('../../dist/math.min.js') + it('should load lib/browser/math.min.js', function () { + const math = require('../../lib/browser/math.min.js') assert.strictEqual(math.add(2, 3), 5) assert.strictEqual(math.version, version) }) - it('should have all expected functions in dist/main.js', function () { + it('should have all expected functions in lib/browser/main.js', function () { // snapshot testing - const math = require('../../dist/math.js') + const math = require('../../lib/browser/math.js') // don't output all warnings "math.foo.bar is move to math.bar, ..." const originalWarn = console.warn @@ -39,9 +39,9 @@ describe('dist', function () { console.warn = originalWarn }) - it('should have all expected functions in dist/main.min.js', function () { + it('should have all expected functions in lib/browser/main.min.js', function () { // snapshot testing - const math = require('../../dist/math.js') + const math = require('../../lib/browser/math.js') // don't output all warnings "math.foo.bar is move to math.bar, ..." const originalWarn = console.warn @@ -57,16 +57,15 @@ describe('dist', function () { }) it('should contain embedded docs for every function', function () { - const math = require('../../dist/math.js') + const math = require('../../lib/browser/math.js') // names to ignore const ignore = [ // functions not supported or relevant for the parser: 'chain', 'print', 'compile', 'parse', 'parser', // TODO: add embedded docs for compile, parse, and parser? - 'reviver', // TODO: add embedded docs for reviver? + 'reviver', 'replacer', // TODO: add embedded docs for reviver and replacer? 'apply', // FIXME: apply is not supported right now because of security concerns - 'eye', 'var', 'eval', 'typeof', // deprecated functions 'addScalar', 'divideScalar', 'multiplyScalar', 'equalScalar' ] diff --git a/test/node-tests/function/alegbra/decomposition/slu.test.js b/test/node-tests/function/alegbra/decomposition/slu.test.js index 02c4c12a2b..e3df170f32 100644 --- a/test/node-tests/function/alegbra/decomposition/slu.test.js +++ b/test/node-tests/function/alegbra/decomposition/slu.test.js @@ -1,5 +1,5 @@ // Only use native node.js API's and references to ./lib here, this file is not transpiled! -const math = require('../../../../../lib/bundleAny') +const math = require('../../../../../lib/cjs/bundleAny') const approx = require('../../../../../tools/approx') const market = require('../../../../../tools/matrixmarket') diff --git a/test/node-tests/function/alegbra/sparse/csAmd.test.js b/test/node-tests/function/alegbra/sparse/csAmd.test.js index bc32377a12..5a99b9b8e9 100644 --- a/test/node-tests/function/alegbra/sparse/csAmd.test.js +++ b/test/node-tests/function/alegbra/sparse/csAmd.test.js @@ -1,6 +1,6 @@ // Only use native node.js API's and references to ./lib here, this file is not transpiled! -const math = require('../../../../../lib/bundleAny') -const { createCsAmd } = require('../../../../../lib/function/algebra/sparse/csAmd') +const math = require('../../../../../lib/cjs/bundleAny') +const { createCsAmd } = require('../../../../../lib/cjs/function/algebra/sparse/csAmd') const assert = require('assert') const approx = require('../../../../../tools/approx') diff --git a/test/node-tests/function/alegbra/sparse/csLu.test.js b/test/node-tests/function/alegbra/sparse/csLu.test.js index 5abbc08d14..a4f7feb86e 100644 --- a/test/node-tests/function/alegbra/sparse/csLu.test.js +++ b/test/node-tests/function/alegbra/sparse/csLu.test.js @@ -1,9 +1,9 @@ // Only use native node.js API's and references to ./lib here, this file is not transpiled! const approx = require('../../../../../tools/approx') -const math = require('../../../../../lib/bundleAny') -const { csPermute } = require('../../../../../lib/function/algebra/sparse/csPermute') -const { createCsLu } = require('../../../../../lib/function/algebra/sparse/csLu') -const { createCsSqr } = require('../../../../../lib/function/algebra/sparse/csSqr') +const math = require('../../../../../lib/cjs/bundleAny') +const { csPermute } = require('../../../../../lib/cjs/function/algebra/sparse/csPermute') +const { createCsLu } = require('../../../../../lib/cjs/function/algebra/sparse/csLu') +const { createCsSqr } = require('../../../../../lib/cjs/function/algebra/sparse/csSqr') const market = require('../../../../../tools/matrixmarket') const { abs, add, divideScalar, multiply, subtract, larger, largerEq, transpose, SparseMatrix } = math diff --git a/test/node-tests/function/arithmetic/multiply.test.js b/test/node-tests/function/arithmetic/multiply.test.js index 33c1ae0265..e150c8fc14 100644 --- a/test/node-tests/function/arithmetic/multiply.test.js +++ b/test/node-tests/function/arithmetic/multiply.test.js @@ -1,5 +1,5 @@ // Only use native node.js API's and references to ./lib here, this file is not transpiled! -const math = require('../../../../lib/bundleAny') +const math = require('../../../../lib/cjs/bundleAny') const market = require('../../../../tools/matrixmarket') describe('multiply', function () { diff --git a/test/node-tests/lib.test.js b/test/node-tests/lib.test.js index 3b35b97577..11ac8e6d02 100644 --- a/test/node-tests/lib.test.js +++ b/test/node-tests/lib.test.js @@ -1,23 +1,34 @@ // Only use native node.js API's and references to ./lib here, this file is not transpiled! const assert = require('assert') +const cp = require('child_process') +const path = require('path') const version = require('../../package.json').version describe('lib', function () { it('should load lib/mainAny.js', function () { - const math = require('../../lib/entry/mainAny') + const math = require('../../lib/cjs/entry/mainAny') assert.strictEqual(math.add(2, 3), 5) }) it('should load lib/mainNumber.js', function () { - const math = require('../../lib/entry/mainNumber') + const math = require('../../lib/cjs/entry/mainNumber') assert.strictEqual(math.add(2, 3), 5) }) it('should have the correct version number', function () { - const math = require('../../lib/entry/mainAny') + const math = require('../../lib/cjs/entry/mainAny') assert.strictEqual(math.version, version) }) + + it('should be robust against pollution of the Object prototype', function (done) { + const filename = path.join(__dirname, 'polluted_object_prototype.js') + cp.exec('node ' + filename, function (error, result) { + assert.strictEqual(error, null) + assert.strictEqual(result, '2i\n') + done() + }) + }) }) diff --git a/test/node-tests/polluted_object_prototype.js b/test/node-tests/polluted_object_prototype.js new file mode 100644 index 0000000000..b21495977d --- /dev/null +++ b/test/node-tests/polluted_object_prototype.js @@ -0,0 +1,10 @@ +// let's pollute the Object prototype... + +/* eslint no-extend-native: ["error", { "exceptions": ["Object"] }] */ +Object.prototype.foo = () => {} + +// loading mathjs should not crash +const math = require('../../lib/cjs/entry/mainAny') + +// outputs '2i' +console.log(math.format(math.sqrt(-4))) diff --git a/test/unit-tests/approx.test.js b/test/unit-tests/approx.test.js index b021977531..0c4b849c98 100644 --- a/test/unit-tests/approx.test.js +++ b/test/unit-tests/approx.test.js @@ -1,7 +1,7 @@ // test approx itself... import assert from 'assert' -import approx from '../../tools/approx' +import approx from '../../tools/approx.js' describe('approx', function () { it('should test equality of positive values', function () { diff --git a/test/unit-tests/bundleAny.test.js b/test/unit-tests/bundleAny.test.js index 602c74b82d..588453bdae 100644 --- a/test/unit-tests/bundleAny.test.js +++ b/test/unit-tests/bundleAny.test.js @@ -1,5 +1,5 @@ import assert from 'assert' -import math from '../../src/bundleAny' +import math from '../../src/bundleAny.cjs' describe('bundleAny', function () { it('should get a default instance of mathjs', function () { diff --git a/test/unit-tests/constants.test.js b/test/unit-tests/constants.test.js index 1e73d0db83..4a31034665 100644 --- a/test/unit-tests/constants.test.js +++ b/test/unit-tests/constants.test.js @@ -1,7 +1,7 @@ import assert from 'assert' -import approx from '../../tools/approx' -import { createBigNumberClass } from '../../src/type/bignumber/BigNumber' -import { createComplexClass } from '../../src/type/complex/Complex' +import approx from '../../tools/approx.js' +import { createBigNumberClass } from '../../src/type/bignumber/BigNumber.js' +import { createComplexClass } from '../../src/type/complex/Complex.js' import { createE, createFalse, @@ -19,7 +19,7 @@ import { createSQRT1_2, // eslint-disable-line camelcase createTau, createTrue -} from '../../src/constants' +} from '../../src/constants.js' describe('constants', function () { describe('number', function () { diff --git a/test/unit-tests/core/import.test.js b/test/unit-tests/core/import.test.js index 951a001d17..d9437b4b41 100644 --- a/test/unit-tests/core/import.test.js +++ b/test/unit-tests/core/import.test.js @@ -259,85 +259,6 @@ describe('import', function () { assert.strictEqual(math.expression.mathWithTransform.mean, mean) }) - describe('legacy factory', function () { - const originalConsoleWarn = console.warn - - before(() => { - console.warn = (...args) => { - // ignore warnings about legacy factories - if (args.join(', ').indexOf('Factories of type { name, factory } are deprecated') === -1) { - console.warn('Unexpected warning!') - originalConsoleWarn.apply(console, args) - } - } - }) - - after(() => { - console.warn = originalConsoleWarn - }) - - it('should merge typed functions coming from a legacy factory', function () { - math.import({ - foo: math.typed('foo', { - number: function (x) { - return 'foo(number)' - } - }) - }) - - math.import({ - name: 'foo', - factory: function () { - return math.typed('foo', { - string: function (x) { - return 'foo(string)' - } - }) - } - }) - - assert.deepStrictEqual(Object.keys(math.foo.signatures).sort(), ['number', 'string']) - assert.strictEqual(math.foo(2), 'foo(number)') - assert.strictEqual(math.foo('bar'), 'foo(string)') - assert.throws(function () { - math.foo(new Date()) - }, /TypeError: Unexpected type of argument in function foo/) - }) - - it('should override a function with transform for a legacy factory function without', function () { - function mean () { - return 'test' - } - - const meanFactory = { - name: 'mean', - factory: () => mean - } - - math.import([meanFactory], { override: true }) - - assert(hasOwnProperty(math, 'mean')) - assert.strictEqual(math.mean, mean) - assert.strictEqual(math.expression.transform.mean, undefined) - assert.strictEqual(math.expression.mathWithTransform.mean, mean) - }) - - it('should throw an error when a legacy factory function has a transform', function () { - assert.throws(function () { - math.import({ - name: 'foo2', - factory: function () { - const fn = function () {} - fn.transform = function () {} - return fn - } - }) - - math.foo2() // as soon as we use it, it will resolve the factory function - }, /Transforms cannot be attached to factory functions/) - }) - }) - describe('factory', () => { it('should import a factory function', () => { const math2 = create() diff --git a/test/unit-tests/expression/Help.test.js b/test/unit-tests/expression/Help.test.js index 3f97a15234..bd2c11fcdd 100644 --- a/test/unit-tests/expression/Help.test.js +++ b/test/unit-tests/expression/Help.test.js @@ -162,7 +162,8 @@ describe('help', function () { }) it('should instantiate Help from json using fromJSON', function () { - const doc = { + const json = { + mathjs: 'Help', name: 'add', category: 'Operators', syntax: [ @@ -179,9 +180,6 @@ describe('help', function () { ] } - const json = Object.create(doc) - json.mathjs = 'Help' - const help = Help.fromJSON(json) assert(help instanceof Help) assert.deepStrictEqual(doc, help.doc) diff --git a/test/unit-tests/expression/Parser.test.js b/test/unit-tests/expression/Parser.test.js index 605614256b..6bf497df1c 100644 --- a/test/unit-tests/expression/Parser.test.js +++ b/test/unit-tests/expression/Parser.test.js @@ -22,18 +22,6 @@ describe('parser', function () { assert.strictEqual(a.type, 'Parser') }) - it('should throw an error when using deprecated function parse', function () { - const parser = new Parser() - - assert.throws(function () { parser.parse('2 + 3') }, /is deprecated/) - }) - - it('should throw an error when using deprecated function compile', function () { - const parser = new Parser() - - assert.throws(function () { parser.compile('2 + 3') }, /is deprecated/) - }) - it('should evaluate an expression', function () { const parser = new Parser() diff --git a/test/unit-tests/expression/function/evaluate.test.js b/test/unit-tests/expression/function/evaluate.test.js index 4cc61407ef..51b6c76a5c 100644 --- a/test/unit-tests/expression/function/evaluate.test.js +++ b/test/unit-tests/expression/function/evaluate.test.js @@ -74,20 +74,4 @@ describe('evaluate', function () { assert.strictEqual(expr1.toTex(), '\\mathrm{evaluate}\\left( expr\\right)') assert.strictEqual(expr2.toTex(), '\\mathrm{evaluate}\\left( expr, scope\\right)') }) - - it('should still allow using the deprecated function math.evaluate', () => { - // deprecated in v6.0.0. Clean up some day - const warnOriginal = console.warn - const logs = [] - console.warn = (...args) => logs.push(args) - - assert.strictEqual(math.eval('2+3'), 5) - - // Note that the following assertion will fail if math.evaluate is already used in a previous unit test - assert.deepStrictEqual(logs, [ - ['Warning:', 'Function "eval" has been renamed to "evaluate" in v6.0.0, please use the new function instead.'] - ]) - - console.warn = warnOriginal - }) }) diff --git a/test/unit-tests/expression/node/ConstantNode.test.js b/test/unit-tests/expression/node/ConstantNode.test.js index 458f02ee5e..b60e4b133b 100644 --- a/test/unit-tests/expression/node/ConstantNode.test.js +++ b/test/unit-tests/expression/node/ConstantNode.test.js @@ -181,6 +181,13 @@ describe('ConstantNode', function () { assert.strictEqual(new ConstantNode(null).toTex(), 'null') }) + it('should LaTeX a ConstantNode with value Infinity', function () { + assert.strictEqual(new ConstantNode(Infinity).toTex(), '\\infty') + assert.strictEqual(new ConstantNode(-Infinity).toTex(), '-\\infty') + assert.strictEqual(new ConstantNode(math.bignumber('Infinity')).toTex(), '\\infty') + assert.strictEqual(new ConstantNode(math.bignumber('-Infinity')).toTex(), '-\\infty') + }) + it('should LaTeX a ConstantNode in exponential notation', function () { const n = new ConstantNode(1e10) assert.strictEqual(n.toTex(), '1\\cdot10^{+10}') diff --git a/test/unit-tests/expression/node/SymbolNode.test.js b/test/unit-tests/expression/node/SymbolNode.test.js index f742cabae4..722477d91b 100644 --- a/test/unit-tests/expression/node/SymbolNode.test.js +++ b/test/unit-tests/expression/node/SymbolNode.test.js @@ -150,9 +150,8 @@ describe('SymbolNode', function () { }) it('should LaTeX a SymbolNode', function () { - const s = new SymbolNode('foo') - - assert.strictEqual(s.toTex(), ' foo') + assert.strictEqual(new SymbolNode('foo').toTex(), ' foo') + assert.strictEqual(new SymbolNode('Infinity').toTex(), '\\infty') }) it('should LaTeX a SymbolNode with custom toTex', function () { diff --git a/test/unit-tests/expression/parse.test.js b/test/unit-tests/expression/parse.test.js index 4ce0c46d8d..7182a05a5c 100644 --- a/test/unit-tests/expression/parse.test.js +++ b/test/unit-tests/expression/parse.test.js @@ -826,6 +826,10 @@ describe('parse', function () { assert.deepStrictEqual(parseAndEval('{a:2+3,b:"foo"}'), { a: 5, b: 'foo' }) }) + it('should create an object with unquoted keys that are keywords', function () { + assert.deepStrictEqual(parseAndEval('{ mod: 1, and: 1, not: 1, or: 1, xor: 1, to: 1, in: 1 }'), { mod: 1, and: 1, not: 1, or: 1, xor: 1, to: 1, in: 1 }) + }) + it('should create an object with child object', function () { assert.deepStrictEqual(parseAndEval('{a:{b:2}}'), { a: { b: 2 } }) }) diff --git a/test/unit-tests/expression/transform/diff.transform.test.js b/test/unit-tests/expression/transform/diff.transform.test.js new file mode 100644 index 0000000000..3b3964ef12 --- /dev/null +++ b/test/unit-tests/expression/transform/diff.transform.test.js @@ -0,0 +1,36 @@ +import assert from 'assert' +import math from '../../../../src/bundleAny' + +const diff = math.expression.transform.diff + +describe('diff.transform', function () { + it('Should use one-based indexing for dimensions with arrays', function () { + // With Dim = 1 + assert.deepStrictEqual(diff([1, 2, 4, 7, 0], 1), [1, 2, 3, -7]) + assert.deepStrictEqual(diff([1, 2, 4, 7, 0], math.bignumber(1)), [1, 2, 3, -7]) + + // Without Dim = 1 + assert.deepStrictEqual(diff([1, 2, 4, 7, 0]), [1, 2, 3, -7]) + }) + + it('Should use one-based indexing for dimensions with matrices', function () { + // With Dim = 1 + assert.deepStrictEqual(diff(math.matrix([1, 2, 4, 7, 0]), 1), math.matrix([1, 2, 3, -7])) + assert.deepStrictEqual(diff(math.matrix([1, 2, 4, 7, 0]), math.bignumber(1)), math.matrix([1, 2, 3, -7])) + + // Without Dim = 1 + assert.deepStrictEqual(diff(math.matrix([1, 2, 4, 7, 0])), math.matrix([1, 2, 3, -7])) + }) + + it('should throw an error if the dimension is below the range for one based indices', function () { + assert.throws(function () { diff(math.matrix([1, 2, 4, 7, 0]), 0) }, Error) + }) + + it('should throw an error if the dimension is above the range for one based indices', function () { + assert.throws(function () { diff(math.matrix([1, 2, 4, 7, 0]), math.bignumber(0)) }, Error) + }) + + it('should work with the parser', function () { + assert.deepStrictEqual(math.evaluate('diff([1, 2, 4, 7, 0], 1)'), math.matrix([1, 2, 3, -7])) + }) +}) diff --git a/test/unit-tests/function/arithmetic/multiply.test.js b/test/unit-tests/function/arithmetic/multiply.test.js index 7a12087c44..3c3d3b699e 100644 --- a/test/unit-tests/function/arithmetic/multiply.test.js +++ b/test/unit-tests/function/arithmetic/multiply.test.js @@ -285,6 +285,14 @@ describe('multiply', function () { approx.deepEqual(multiply(matrix(a), matrix(b)), 32) }) + it('should conjugate the first argument in dot product', function () { + const a = [complex(1, 2), complex(3, 4)] + const b = [complex(5, 6), complex(7, 8)] + + approx.deepEqual(multiply(a, b), complex(70, -8)) + approx.deepEqual(multiply(matrix(a), matrix(b)), complex(70, -8)) + }) + it('should multiply row vector x column vector', function () { const v = [[1, 2, 3, 0, 0, 5, 6]] diff --git a/test/unit-tests/function/matrix/diff.test.js b/test/unit-tests/function/matrix/diff.test.js new file mode 100644 index 0000000000..fb50af45b5 --- /dev/null +++ b/test/unit-tests/function/matrix/diff.test.js @@ -0,0 +1,194 @@ +import assert from 'assert' +import approx from '../../../../tools/approx' +import math from '../../../../src/bundleAny' + +// Parsing tests are inside diff.transform.test + +const matrix = math.matrix +const diff = math.diff + +const smallTestArray = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [9, 8, 7, 6, 4]] + +const smallTestArrayDimension0 = [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]] +const smallTestArrayDimension1 = [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]] + +// largeTestArrayDimension0-3 were generated from largeTestArray using numpy.diff() for consistency. Please dont change them because they are a pain to get linted correctly +const largeTestArray = [[[[1, 2, 3], [2, 3, 4], [3, 4, 5]], [[3, 2, 1], [2, 3, 4], [5, 4, 3]], [[5, 2, 1], [5, 2, 1], [5, 2, 1]]], [[[8, 12, 345], [23, 35, 23], [123, 234, 12]], [[1, 2, 3], [1, 3, 5], [5, 6, 7]], [[66, 55, 44], [32, 32, 1], [0, 1, 2]]], [[[1, 64, 3], [2, 34, 61], [128, 92, 64]], [[12, 2, 1], [6, 8, 9], [2, 7, 3]], [[52, 22, 21], [55, 52, 51], [111, 12, 11]]]] + +const largeTestArrayDimension0 = [[[[7, 10, 342], [21, 32, 19], [120, 230, 7]], [[-2, 0, 2], [-1, 0, 1], [0, 2, 4]], [[61, 53, 43], [27, 30, 0], [-5, -1, 1]]], [[[-7, 52, -342], [-21, -1, 38], [5, -142, 52]], [[11, 0, -2], [5, 5, 4], [-3, 1, -4]], [[-14, -33, -23], [23, 20, 50], [111, 11, 9]]]] +const largeTestArrayDimension1 = [[[[2, 0, -2], [0, 0, 0], [2, 0, -2]], [[2, 0, 0], [3, -1, -3], [0, -2, -2]]], [[[-7, -10, -342], [-22, -32, -18], [-118, -228, -5]], [[65, 53, 41], [31, 29, -4], [-5, -5, -5]]], [[[11, -62, -2], [4, -26, -52], [-126, -85, -61]], [[40, 20, 20], [49, 44, 42], [109, 5, 8]]]] +const largeTestArrayDimension2 = [[[[1, 1, 1], [1, 1, 1]], [[-1, 1, 3], [3, 1, -1]], [[0, 0, 0], [0, 0, 0]]], [[[15, 23, -322], [100, 199, -11]], [[0, 1, 2], [4, 3, 2]], [[-34, -23, -43], [-32, -31, 1]]], [[[1, -30, 58], [126, 58, 3]], [[-6, 6, 8], [-4, -1, -6]], [[3, 30, 30], [56, -40, -40]]]] +const largeTestArrayDimension3 = [[[[1, 1], [1, 1], [1, 1]], [[-1, -1], [1, 1], [-1, -1]], [[-3, -1], [-3, -1], [-3, -1]]], [[[4, 333], [12, -12], [111, -222]], [[1, 1], [2, 2], [1, 1]], [[-11, -11], [0, -31], [1, 1]]], [[[63, -61], [32, 27], [-36, -28]], [[-10, -1], [2, 1], [5, -4]], [[-30, -1], [-3, -1], [-99, -1]]]] + +describe('diff', function () { + it('should return original array/matrix for less than 2 elements, with and without specified dimension', function () { + // With Dim = 0 specified + assert.deepStrictEqual(diff([], 0), []) + assert.deepStrictEqual(diff(matrix([]), 0), matrix([])) + assert.deepStrictEqual(diff([2], 0), [2]) + assert.deepStrictEqual(diff(matrix([2]), 0), matrix([2])) + + // Without Dim = 0 specified + assert.deepStrictEqual(diff([]), []) + assert.deepStrictEqual(diff(matrix([])), matrix([])) + assert.deepStrictEqual(diff([2]), [2]) + assert.deepStrictEqual(diff(matrix([2])), matrix([2])) + }) + + it('should return difference between elements of a 1-dimensional array, with and without specified dimension', function () { + // With Dim = 0 + assert.deepStrictEqual(diff([1, 2, 4, 7, 0], 0), [1, 2, 3, -7]) + + // Without Dim = 0 + assert.deepStrictEqual(diff([1, 2, 4, 7, 0]), [1, 2, 3, -7]) + }) + + it('should return difference between elements of a 1-dimensional matrix, with and without specified dimension', function () { + // With Dim = 0 + assert.deepStrictEqual(diff(matrix([1, 2, 4, 7, 0]), 0), matrix([1, 2, 3, -7])) + + // Without Dim = 0 + assert.deepStrictEqual(diff(matrix([1, 2, 4, 7, 0])), matrix([1, 2, 3, -7])) + }) + + it('should return difference between elements of a 2-dimensional array, with and without specified dimension', function () { + // With Dim specified + assert.deepStrictEqual(diff(smallTestArray, 0), smallTestArrayDimension0) + assert.deepStrictEqual(diff(smallTestArray, 1), smallTestArrayDimension1) + assert.deepStrictEqual(diff(smallTestArray, math.bignumber(1)), smallTestArrayDimension1) + + // Without Dim specified + assert.deepStrictEqual(diff(smallTestArray), smallTestArrayDimension0) + }) + + it('should return difference between elements of a 2-dimensional matrix, with and without specified dimension', function () { + // With Dim specified + assert.deepStrictEqual(diff(matrix(smallTestArray), 0), matrix(smallTestArrayDimension0)) + assert.deepStrictEqual(diff(matrix(smallTestArray), 1), matrix(smallTestArrayDimension1)) + + // Without Dim specified + assert.deepStrictEqual(diff(matrix(smallTestArray)), matrix(smallTestArrayDimension0)) + }) + + it('should return difference between elements of a 4-dimensional array, with and without specified dimension', function () { + // With Dim specified + assert.deepStrictEqual(diff(largeTestArray, 0), largeTestArrayDimension0) + assert.deepStrictEqual(diff(largeTestArray, 1), largeTestArrayDimension1) + assert.deepStrictEqual(diff(largeTestArray, 2), largeTestArrayDimension2) + assert.deepStrictEqual(diff(largeTestArray, 3), largeTestArrayDimension3) + assert.deepStrictEqual(diff(largeTestArray, math.bignumber(1)), largeTestArrayDimension1) + assert.deepStrictEqual(diff(largeTestArray, math.bignumber(2)), largeTestArrayDimension2) + assert.deepStrictEqual(diff(largeTestArray, math.bignumber(3)), largeTestArrayDimension3) + + // Without Dim specified + assert.deepStrictEqual(diff(largeTestArray), largeTestArrayDimension0) + }) + + it('should return difference between elements of a 4-dimensional matrix, with and without specified dimension', function () { + // With Dim specified + assert.deepStrictEqual(diff(matrix(largeTestArray), 0), matrix(largeTestArrayDimension0)) + assert.deepStrictEqual(diff(matrix(largeTestArray), 1), matrix(largeTestArrayDimension1)) + assert.deepStrictEqual(diff(matrix(largeTestArray), 2), matrix(largeTestArrayDimension2)) + assert.deepStrictEqual(diff(matrix(largeTestArray), 3), matrix(largeTestArrayDimension3)) + + // Without Dim specified + assert.deepStrictEqual(diff(matrix(largeTestArray)), matrix(largeTestArrayDimension0)) + }) + + it('should treat an array of matrices as an array of arrays', function () { + // With Dim = 0 + assert.deepStrictEqual(diff([matrix([1, 2]), matrix([3, 4])], 0), [[2, 2]]) + assert.deepStrictEqual(diff([matrix([1, 2]), matrix([3, 4])], 1), [[1], [1]]) + assert.deepStrictEqual(diff([[1, 2], matrix([3, 4])], 0), [[2, 2]]) + assert.deepStrictEqual(diff([[1, 2], matrix([3, 4])], 1), [[1], [1]]) + assert.deepStrictEqual(diff([matrix([1, 2]), [3, 4]], 0), [[2, 2]]) + assert.deepStrictEqual(diff([matrix([1, 2]), [3, 4]], 1), [[1], [1]]) + + // Without Dim = 0 + assert.deepStrictEqual(diff([matrix([1, 2]), matrix([3, 4])]), [[2, 2]]) + assert.deepStrictEqual(diff([[1, 2], matrix([3, 4])]), [[2, 2]]) + assert.deepStrictEqual(diff([matrix([1, 2]), [3, 4]]), [[2, 2]]) + }) + + it('should be consistent with bignumber', function () { + // 4-dim array but done with bignumber + assert.deepStrictEqual(diff(math.bignumber(largeTestArray), 0), math.bignumber(largeTestArrayDimension0)) + assert.deepStrictEqual(diff(math.bignumber(largeTestArray), 1), math.bignumber(largeTestArrayDimension1)) + assert.deepStrictEqual(diff(math.bignumber(largeTestArray), 2), math.bignumber(largeTestArrayDimension2)) + assert.deepStrictEqual(diff(math.bignumber(largeTestArray), 3), math.bignumber(largeTestArrayDimension3)) + + // Without Dim specified + assert.deepStrictEqual(diff(math.bignumber(largeTestArray)), math.bignumber(largeTestArrayDimension0)) + }) + + it('should be consistent with fraction', function () { + // 4-dim array but done with bignumber + assert.deepStrictEqual(diff(math.fraction(largeTestArray), 0), math.fraction(largeTestArrayDimension0)) + assert.deepStrictEqual(diff(math.fraction(largeTestArray), 1), math.fraction(largeTestArrayDimension1)) + assert.deepStrictEqual(diff(math.fraction(largeTestArray), 2), math.fraction(largeTestArrayDimension2)) + assert.deepStrictEqual(diff(math.fraction(largeTestArray), 3), math.fraction(largeTestArrayDimension3)) + + // Without Dim specified + assert.deepStrictEqual(diff(math.fraction(largeTestArray)), math.fraction(largeTestArrayDimension0)) + }) + + it('should be consistent with units', function () { + // Derived from previous smallTestArray + const smallUnitsArray = [[math.unit('1 cm'), math.unit('2 cm'), math.unit('3 cm'), math.unit('4 cm'), math.unit('5 cm')], [math.unit('1 cm'), math.unit('2 cm'), math.unit('3 cm'), math.unit('4 cm'), math.unit('5 cm')], [math.unit('9 cm'), math.unit('8 cm'), math.unit('7 cm'), math.unit('6 cm'), math.unit('4 cm')]] + + const smallUnitsArrayDimension0 = [[math.unit('0 cm'), math.unit('0 cm'), math.unit('0 cm'), math.unit('0 cm'), math.unit('0 cm')], [math.unit('8 cm'), math.unit('6 cm'), math.unit('4 cm'), math.unit('2 cm'), math.unit('-1 cm')]] + const smallUnitsArrayDimension1 = [[math.unit('1 cm'), math.unit('1 cm'), math.unit('1 cm'), math.unit('1 cm')], [math.unit('1 cm'), math.unit('1 cm'), math.unit('1 cm'), math.unit('1 cm')], [math.unit('-1 cm'), math.unit('-1 cm'), math.unit('-1 cm'), math.unit('-2 cm')]] + + // With Dim specified + approx.deepEqual(diff(smallUnitsArray, 0), smallUnitsArrayDimension0) + approx.deepEqual(diff(smallUnitsArray, 1), smallUnitsArrayDimension1) + + // Without Dim specified + approx.deepEqual(diff(smallUnitsArray), smallUnitsArrayDimension0) + }) + + it('should throw if input is not an array or matrix', function () { + assert.throws(function () { diff(1, 0) }, TypeError) + }) + + it('should throw if dimension is too large, negative or not an integer', function () { + // Not enough dimensions in the array + assert.throws(function () { diff([1, 2, 3, 4], 1) }, RangeError) + assert.throws(function () { diff(matrix([1, 2, 3, 4]), 1) }, RangeError) + + // No negative dimensions + assert.throws(function () { diff([1, 2, 3, 4], -1) }, RangeError) + assert.throws(function () { diff(matrix([1, 2, 3, 4]), -1) }, RangeError) + + // No decimal dimensions + assert.throws(function () { diff(matrix([1, 2, 3, 4]), 0.5) }, RangeError) + assert.throws(function () { diff(matrix([1, 2, 3, 4]), -0.5) }, RangeError) + }) + + it('should throw if bignumber is not a valid index', function () { + // Not enough dimensions in the array + assert.throws(function () { diff([1, 2, 3, 4], math.bignumber(1)) }, RangeError) + assert.throws(function () { diff(matrix([1, 2, 3, 4]), math.bignumber(1)) }, RangeError) + + // No negative dimensions + assert.throws(function () { diff([1, 2, 3, 4], math.bignumber(-1)) }, RangeError) + assert.throws(function () { diff(matrix([1, 2, 3, 4]), math.bignumber(-1)) }, RangeError) + + // No decimal dimensions + assert.throws(function () { diff(matrix([1, 2, 3, 4]), math.bignumber(0.5)) }, RangeError) + assert.throws(function () { diff(matrix([1, 2, 3, 4]), math.bignumber(-0.5)) }, RangeError) + + // Infinity + assert.throws(function () { diff(matrix([1, 2, 3, 4]), Infinity) }, RangeError) + assert.throws(function () { diff(matrix([1, 2, 3, 4]), -Infinity) }, RangeError) + assert.throws(function () { diff(matrix([1, 2, 3, 4]), math.bignumber('Infinity')) }, RangeError) + assert.throws(function () { diff(matrix([1, 2, 3, 4]), math.bignumber('-Infinity')) }, RangeError) + }) + + it('should throw if array is not \'rectangular\'', function () { + // Matrices are already 'rectangular' so this error doesnt apply to them + // The first one throws TypeError for trying to do 2 - [3,4] whereas the second one throws RangeError as [1,2].length != [3,4,3].length + assert.throws(function () { diff([1, 2, [3, 4]], 0) }, TypeError) + assert.throws(function () { diff([[1, 2], [3, 4, 3]], 0) }, RangeError) + }) +}) diff --git a/test/unit-tests/function/matrix/dot.test.js b/test/unit-tests/function/matrix/dot.test.js index e2c7d6704b..a3de75795c 100644 --- a/test/unit-tests/function/matrix/dot.test.js +++ b/test/unit-tests/function/matrix/dot.test.js @@ -1,40 +1,93 @@ import assert from 'assert' import math from '../../../../src/bundleAny' +const dot = math.dot +const matrix = math.matrix +const sparse = math.sparse +const complex = math.complex + describe('dot', function () { - it('should calculate dot product for two arrays', function () { - assert.strictEqual(math.dot([2, 4, 1], [2, 2, 3]), 15) - assert.strictEqual(math.dot([7, 3], [2, 4]), 26) + it('should calculate dot product for two 1-dim arrays', function () { + assert.strictEqual(dot([2, 4, 1], [2, 2, 3]), 15) + assert.strictEqual(dot([7, 3], [2, 4]), 26) + }) + + it('should calculate dot product for two column arrays', function () { + assert.strictEqual(dot([[2], [4], [1]], [[2], [2], [3]]), 15) + assert.strictEqual(dot([[7], [3]], [[2], [4]]), 26) + }) + + it('should calculate dot product for two 1-dim vectors', function () { + assert.strictEqual(dot(matrix([2, 4, 1]), matrix([2, 2, 3])), 15) + assert.strictEqual(dot(matrix([7, 3]), matrix([2, 4])), 26) + }) + + it('should calculate dot product for two column vectors', function () { + assert.strictEqual(dot(matrix([[2], [4], [1]]), matrix([[2], [2], [3]])), 15) + assert.strictEqual(dot(matrix([[7], [3]]), matrix([[2], [4]])), 26) + }) + + it('should calculate dot product for mixed 1-dim arrays and column arrays', function () { + assert.strictEqual(dot([2, 4, 1], [[2], [2], [3]]), 15) + assert.strictEqual(dot([[7], [3]], [2, 4]), 26) + }) + + it('should calculate dot product for mixed 1-dim arrays and 1-dim vectors', function () { + assert.strictEqual(dot([2, 4, 1], matrix([2, 2, 3])), 15) + assert.strictEqual(dot(matrix([7, 3]), [2, 4]), 26) + }) + + it('should calculate dot product for mixed 1-dim arrays and column vectors', function () { + assert.strictEqual(dot([2, 4, 1], matrix([[2], [2], [3]])), 15) + assert.strictEqual(dot(matrix([[7], [3]]), [2, 4]), 26) + }) + + it('should calculate dot product for mixed column arrays and 1-dim vectors', function () { + assert.strictEqual(dot([[2], [4], [1]], matrix([2, 2, 3])), 15) + assert.strictEqual(dot(matrix([7, 3]), [[2], [4]]), 26) }) - it('should calculate dot product for two matrices', function () { - assert.strictEqual(math.dot(math.matrix([2, 4, 1]), math.matrix([2, 2, 3])), 15) - assert.strictEqual(math.dot(math.matrix([7, 3]), math.matrix([2, 4])), 26) + it('should calculate dot product for mixed column arrays and column vectors', function () { + assert.strictEqual(dot([[2], [4], [1]], matrix([[2], [2], [3]])), 15) + assert.strictEqual(dot(matrix([[7], [3]]), [[2], [4]]), 26) }) - it('should calculate dot product for mixed arrays and matrices', function () { - assert.strictEqual(math.dot([2, 4, 1], math.matrix([2, 2, 3])), 15) - assert.strictEqual(math.dot(math.matrix([7, 3]), [2, 4]), 26) + it('should calculate dot product for mixed 1-dim vectors and column vectors', function () { + assert.strictEqual(dot(matrix([2, 4, 1]), matrix([[2], [2], [3]])), 15) + assert.strictEqual(dot(matrix([[7], [3]]), matrix([2, 4])), 26) + }) + + it('should calculate dot product for sparse vectors', function () { + assert.strictEqual(dot(sparse([0, 0, 2, 4, 4, 1]), sparse([1, 0, 2, 2, 0, 3])), 15) + assert.strictEqual(dot(sparse([7, 1, 2, 3]), sparse([2, 0, 0, 4])), 26) }) it('should throw an error for unsupported types of arguments', function () { - assert.throws(function () { math.dot([2, 4, 1], 2) }, TypeError) + assert.throws(function () { dot([2, 4, 1], 2) }, TypeError) }) it('should throw an error for multi dimensional matrix input', function () { - assert.throws(function () { math.dot([[1, 2], [3, 4]], [[1, 2], [3, 4]]) }, /Vector expected/) + assert.throws(function () { dot([[1, 2], [3, 4]], [[1, 2], [3, 4]]) }, /Expected a column vector, instead got a matrix of size \(2, 2\)/) }) it('should throw an error in case of vectors with unequal length', function () { - assert.throws(function () { math.dot([2, 3], [1, 2, 3]) }, /Vectors must have equal length \(2 != 3\)/) + assert.throws(function () { dot([2, 3], [1, 2, 3]) }, /Vectors must have equal length \(2 != 3\)/) }) it('should throw an error in case of empty vectors', function () { - assert.throws(function () { math.dot([], []) }, /Cannot calculate the dot product of empty vectors/) + assert.throws(function () { dot([], []) }, /Cannot calculate the dot product of empty vectors/) }) it('should LaTeX dot', function () { const expression = math.parse('dot([1,2],[3,4])') assert.strictEqual(expression.toTex(), '\\left(\\begin{bmatrix}1\\\\2\\\\\\end{bmatrix}\\cdot\\begin{bmatrix}3\\\\4\\\\\\end{bmatrix}\\right)') }) + + it('should be antilinear in the first argument', function () { + const I = complex(0, 1) + assert.deepStrictEqual(dot([I, 2], [1, I]), I) + + const v = matrix([2, I, 1]) + assert.deepStrictEqual(dot(v, v).sqrt(), complex(math.norm(v))) + }) }) diff --git a/test/unit-tests/function/matrix/eigs.test.js b/test/unit-tests/function/matrix/eigs.test.js index 8a0dddc20e..483628753e 100644 --- a/test/unit-tests/function/matrix/eigs.test.js +++ b/test/unit-tests/function/matrix/eigs.test.js @@ -105,4 +105,17 @@ describe('eigs', function () { } approx.deepEqual(Ei, E) }) + + it('make sure BigNumbers input is actually calculated with BigNumber precision', function () { + const B = math.bignumber([ + [0, 1], + [1, 0] + ]) + const eig = math.eigs(B) + + assert.strictEqual(eig.values[0].toString(), + '-0.9999999999999999999999999999999999999999999999999999999999999999') + assert.strictEqual(eig.values[1].toString(), + '0.9999999999999999999999999999999999999999999999999999999999999999') + }) }) diff --git a/test/unit-tests/function/matrix/identity.test.js b/test/unit-tests/function/matrix/identity.test.js index f63bfdbc70..0ff31e991a 100644 --- a/test/unit-tests/function/matrix/identity.test.js +++ b/test/unit-tests/function/matrix/identity.test.js @@ -67,8 +67,4 @@ describe('identity', function () { const expression = math.parse('identity(2)') assert.strictEqual(expression.toTex(), '\\mathrm{identity}\\left(2\\right)') }) - - it('should throw an error when using the deprecated function eye', function () { - assert.throws(function () { math.eye(2) }, /Function "eye" is renamed to "identity"/) - }) }) diff --git a/test/unit-tests/function/matrix/size.test.js b/test/unit-tests/function/matrix/size.test.js index 8e7672d78b..ef1261750b 100644 --- a/test/unit-tests/function/matrix/size.test.js +++ b/test/unit-tests/function/matrix/size.test.js @@ -20,12 +20,18 @@ describe('size', function () { assert.deepStrictEqual(size([[[], []]]), [1, 2, 0]) }) - it('should calculate the size of a matrix', function () { + it('should calculate the size of a DenseMatrix', function () { assert.deepStrictEqual(size(matrix()), matrix([0])) assert.deepStrictEqual(size(matrix([[1, 2, 3], [4, 5, 6]])), matrix([2, 3])) assert.deepStrictEqual(size(matrix([[], []])), matrix([2, 0])) }) + it('should calculate the size of a SparseMatrix', function () { + assert.deepStrictEqual(size(matrix('sparse')), matrix([0, 0], 'sparse')) + assert.deepStrictEqual(size(matrix([[1, 2, 3], [4, 5, 6]], 'sparse')), matrix([2, 3], 'sparse')) + assert.deepStrictEqual(size(matrix([[], []], 'sparse')), matrix([2, 0], 'sparse')) + }) + it('should calculate the size of a range', function () { assert.deepStrictEqual(size(math.range(2, 6)), matrix([4])) }) diff --git a/test/unit-tests/function/statistics/max.test.js b/test/unit-tests/function/statistics/max.test.js index 5df6415da6..b2b3337098 100644 --- a/test/unit-tests/function/statistics/max.test.js +++ b/test/unit-tests/function/statistics/max.test.js @@ -20,7 +20,8 @@ describe('max', function () { }) it('should return the max of strings by their numerical value', function () { - assert.strictEqual(max('10', '3', '4', '2'), '10') + assert.strictEqual(max('10', '3', '4', '2'), 10) + assert.strictEqual(max('10'), 10) }) it('should return the max element from a vector', function () { @@ -98,6 +99,8 @@ describe('max', function () { assert.throws(function () { max([[2, new Date(), 4]]) }, /TypeError: Cannot calculate max, unexpected type of argument/) assert.throws(function () { max([2, null, 4]) }, /TypeError: Cannot calculate max, unexpected type of argument/) assert.throws(function () { max([[2, 5], [4, null], [1, 7]], 0) }, /TypeError: Cannot calculate max, unexpected type of argument/) + assert.throws(function () { max('a', 'b') }, /Error: Cannot convert "b" to a number/) + assert.throws(function () { max('a') }, /SyntaxError: String "a" is no valid number/) }) it('should return undefined if called with an empty array', function () { diff --git a/test/unit-tests/function/statistics/mean.test.js b/test/unit-tests/function/statistics/mean.test.js index 13930a68b9..f33cce1df9 100644 --- a/test/unit-tests/function/statistics/mean.test.js +++ b/test/unit-tests/function/statistics/mean.test.js @@ -15,6 +15,11 @@ describe('mean', function () { assert.strictEqual(mean(0, 0, 0, 0), 0) }) + it('should return the mean value of strings by their numerical value', function () { + assert.strictEqual(mean('1', '3', '5', '2', '-5'), 1.2) + assert.strictEqual(mean('5'), 5) + }) + it('should return the mean of big numbers', function () { assert.deepStrictEqual(mean(new BigNumber(1), new BigNumber(3), new BigNumber(5), new BigNumber(2), new BigNumber(-5)), new BigNumber(1.2)) @@ -126,6 +131,8 @@ describe('mean', function () { assert.throws(function () { mean([[2, new Date(), 4]]) }, /TypeError: Cannot calculate mean, unexpected type of argument/) assert.throws(function () { mean([2, null, 4]) }, /TypeError: Cannot calculate mean, unexpected type of argument/) assert.throws(function () { mean([[2, 5], [4, null], [1, 7]], 0) }, /TypeError: Cannot calculate mean, unexpected type of argument/) + assert.throws(function () { mean('a', 'b') }, /Error: Cannot convert "a" to a number/) + assert.throws(function () { mean('a') }, /Error: Cannot convert "a" to a number/) }) it('should LaTeX mean', function () { diff --git a/test/unit-tests/function/statistics/min.test.js b/test/unit-tests/function/statistics/min.test.js index ff97226d21..344b726c8d 100644 --- a/test/unit-tests/function/statistics/min.test.js +++ b/test/unit-tests/function/statistics/min.test.js @@ -15,7 +15,8 @@ describe('min', function () { }) it('should return the min of strings by their numerical value', function () { - assert.strictEqual(min('10', '3', '4', '2'), '2') + assert.strictEqual(min('10', '3', '4', '2'), 2) + assert.strictEqual(min('10'), 10) }) it('should return the min element from a vector', function () { @@ -111,6 +112,8 @@ describe('min', function () { assert.throws(function () { min([[2, new Date(), 4]]) }, /TypeError: Cannot calculate min, unexpected type of argument/) assert.throws(function () { min([2, null, 4]) }, /TypeError: Cannot calculate min, unexpected type of argument/) assert.throws(function () { min([[2, 5], [4, null], [1, 7]], 0) }, /TypeError: Cannot calculate min, unexpected type of argument/) + assert.throws(function () { min('a', 'b') }, /Error: Cannot convert "b" to a number/) + assert.throws(function () { min('a') }, /SyntaxError: String "a" is no valid number/) }) it('should LaTeX min', function () { diff --git a/test/unit-tests/function/statistics/prod.test.js b/test/unit-tests/function/statistics/prod.test.js index f4b40568d8..4b97fcba58 100644 --- a/test/unit-tests/function/statistics/prod.test.js +++ b/test/unit-tests/function/statistics/prod.test.js @@ -19,6 +19,12 @@ describe('prod', function () { new BigNumber(30)) }) + it('should return the product of strings (convert them to numbers)', function () { + assert.strictEqual(prod('2', '3'), 6) + assert.strictEqual(prod('2'), 2) + assert.strictEqual(prod([['1', '3'], ['5', '2']]), 30) + }) + it('should return the product of complex numbers', function () { assert.deepStrictEqual(prod(new Complex(2, 3), new Complex(-1, 2)), new Complex(-8, 1)) }) @@ -74,6 +80,8 @@ describe('prod', function () { assert.throws(function () { prod([[2, undefined, 4]]) }, /TypeError: Cannot calculate prod, unexpected type of argument/) assert.throws(function () { prod([[2, new Date(), 4]]) }, /TypeError: Cannot calculate prod, unexpected type of argument/) assert.throws(function () { prod([2, null, 4]) }, /TypeError: Cannot calculate prod, unexpected type of argument/) + assert.throws(function () { prod('a', 'b') }, /Error: Cannot convert "a" to a number/) + assert.throws(function () { prod('a') }, /SyntaxError: String "a" is no valid number/) }) it('should LaTeX prod', function () { diff --git a/test/unit-tests/function/statistics/quantileSeq.test.js b/test/unit-tests/function/statistics/quantileSeq.test.js index 58524a8536..24e1cffe7e 100644 --- a/test/unit-tests/function/statistics/quantileSeq.test.js +++ b/test/unit-tests/function/statistics/quantileSeq.test.js @@ -151,11 +151,11 @@ describe('quantileSeq', function () { }) it('should throw an error if called with unsupported type of arguments', function () { - assert.throws(function () { quantileSeq([2, 4, 6, 8, 10, 12, 14], 0.25, 10) }, math.error.UnsupportedTypeError) - assert.throws(function () { quantileSeq([2, 4, 6, 8, 10, 12, 14], [0.25, 2]) }, math.error.UnsuppoError) - assert.throws(function () { quantileSeq('A', 'C', 'B') }, math.error.UnsupportedTypeError) - assert.throws(function () { quantileSeq(true, false, true) }, math.error.UnsupportedTypeError) - assert.throws(function () { quantileSeq(0, 'B') }, math.error.UnsupportedTypeError) + assert.throws(function () { quantileSeq([2, 4, 6, 8, 10, 12, 14], 0.25, 10) }, math.UnsupportedTypeError) + assert.throws(function () { quantileSeq([2, 4, 6, 8, 10, 12, 14], [0.25, 2]) }, math.UnsuppoError) + assert.throws(function () { quantileSeq('A', 'C', 'B') }, math.UnsupportedTypeError) + assert.throws(function () { quantileSeq(true, false, true) }, math.UnsupportedTypeError) + assert.throws(function () { quantileSeq(0, 'B') }, math.UnsupportedTypeError) assert.throws(function () { quantileSeq(math.complex(2, 3), math.complex(-1, 2)) }, /TypeError: Unexpected type of argument in function quantileSeq/) assert.throws(function () { quantileSeq(2, null) }, /TypeError: Unexpected type of argument in function quantileSeq/) diff --git a/test/unit-tests/function/statistics/sum.test.js b/test/unit-tests/function/statistics/sum.test.js index 866a44401b..4c69de5530 100644 --- a/test/unit-tests/function/statistics/sum.test.js +++ b/test/unit-tests/function/statistics/sum.test.js @@ -22,6 +22,7 @@ describe('sum', function () { it('should return the sum of strings (convert them to numbers)', function () { assert.strictEqual(sum('2', '3', '4', '5'), 14) + assert.strictEqual(sum('2'), 2) assert.strictEqual(sum([['2', '3'], ['4', '5']]), 14) }) @@ -114,6 +115,8 @@ describe('sum', function () { assert.throws(function () { sum(new Date(), 2) }, /Cannot calculate sum, unexpected type of argument/) assert.throws(function () { sum(2, 3, null) }, /Cannot calculate sum, unexpected type of argument/) assert.throws(function () { sum([2, 3, null]) }, /Cannot calculate sum, unexpected type of argument/) + assert.throws(function () { sum('a', 'b') }, /Error: Cannot convert "a" to a number/) + assert.throws(function () { sum('a') }, /SyntaxError: String "a" is no valid number/) }) it('should LaTeX sum', function () { diff --git a/test/unit-tests/function/statistics/variance.test.js b/test/unit-tests/function/statistics/variance.test.js index fee68ef63a..166304d4d1 100644 --- a/test/unit-tests/function/statistics/variance.test.js +++ b/test/unit-tests/function/statistics/variance.test.js @@ -12,6 +12,11 @@ describe('variance', function () { assert.strictEqual(variance(2, 4, 6), 4) }) + it('should return the variance of strings by their numerical values', function () { + assert.strictEqual(variance('2', '4', '6'), 4) + assert.strictEqual(variance('5'), 0) + }) + it('should return the variance of big numbers', function () { assert.deepStrictEqual(variance(new BigNumber(2), new BigNumber(4), new BigNumber(6)), new math.BigNumber(4)) @@ -109,6 +114,8 @@ describe('variance', function () { assert.throws(function () { variance([2, 3, null]) }, /Cannot calculate variance, unexpected type of argument/) assert.throws(function () { variance([[2, 4, 6], [1, 3, 5]], 'biased', 0) }, /Cannot convert "biased" to a number/) assert.throws(function () { variance([[2, 4, 6], [1, 3, 5]], 0, new Date()) }, /Cannot calculate variance, unexpected type of argument/) + assert.throws(function () { variance('a', 'b') }, /Error: Cannot convert "a" to a number/) + assert.throws(function () { variance('a') }, /Error: Cannot convert "a" to a number/) }) it('should throw an error if the axis exceeds the dimension of the matrix') @@ -121,20 +128,4 @@ describe('variance', function () { const expression = math.parse('variance(1,2,3)') assert.strictEqual(expression.toTex(), '\\mathrm{Var}\\left(1,2,3\\right)') }) - - it('should still allow using the deprecated function math.var', () => { - // deprecated in v6.0.0. Clean up some day - const warnOriginal = console.warn - const logs = [] - console.warn = (...args) => logs.push(args) - - assert.strictEqual(math.var(2, 4, 6), 4) - - // Note that the following assertion will fail if math.var is already used in a previous unit test - assert.deepStrictEqual(logs, [ - ['Warning:', 'Function "var" has been renamed to "variance" in v6.0.0, please use the new function instead.'] - ]) - - console.warn = warnOriginal - }) }) diff --git a/test/unit-tests/function/string/format.test.js b/test/unit-tests/function/string/format.test.js index 725d178c57..29cc2500d4 100644 --- a/test/unit-tests/function/string/format.test.js +++ b/test/unit-tests/function/string/format.test.js @@ -71,6 +71,7 @@ describe('format', function () { }) it('should format positive three digits to engineering notation', function () { assert.strictEqual(math.format(300, { notation: 'engineering' }), '300e+0') + assert.strictEqual(math.format(320, { notation: 'engineering' }), '320e+0') }) it('should format positive four digits to engineering notation', function () { assert.strictEqual(math.format(3000, { notation: 'engineering' }), '3e+3') @@ -78,6 +79,10 @@ describe('format', function () { it('should format positive uneven four digits to engineering notation', function () { assert.strictEqual(math.format(3001, { notation: 'engineering' }), '3.001e+3') }) + it('should format a number without trailing zeros to engineering notation', function () { + assert.strictEqual(math.format(3010, { notation: 'engineering' }), '3.01e+3') + assert.strictEqual(math.format(452550000, { notation: 'engineering' }), '452.55e+6') + }) it('should format positive uneven ten digits to engineering notation', function () { assert.strictEqual(math.format(3741293481, { notation: 'engineering' }), '3.741293481e+9') }) @@ -89,6 +94,8 @@ describe('format', function () { }) it('should format positive two digit floating point numbers to engineering notation', function () { assert.strictEqual(math.format(0.01, { notation: 'engineering' }), '10e-3') + assert.strictEqual(math.format(0.011, { notation: 'engineering' }), '11e-3') + assert.strictEqual(math.format(0.0111, { notation: 'engineering' }), '11.1e-3') }) it('should format positive three digit floating point numbers to engineering notation', function () { assert.strictEqual(math.format(0.003, { notation: 'engineering' }), '3e-3') @@ -101,6 +108,7 @@ describe('format', function () { }) it('should format negative single digit floating point numbers to engineering notation', function () { assert.strictEqual(math.format(-0.1, { notation: 'engineering' }), '-100e-3') + assert.strictEqual(math.format(-0.11, { notation: 'engineering' }), '-110e-3') }) it('should format positive floating point number to engineering notation', function () { assert.strictEqual(math.format(13308.0333333333, { precision: 11, notation: 'engineering' }), '13.308033333e+3') @@ -194,6 +202,7 @@ describe('format', function () { }) it('should format positive three digits to engineering notation', function () { assert.strictEqual(math.format(bignumber(300), { notation: 'engineering' }), '300e+0') + assert.strictEqual(math.format(bignumber(320), { notation: 'engineering' }), '320e+0') }) it('should format positive four digits to engineering notation', function () { assert.strictEqual(math.format(bignumber(3000), { notation: 'engineering' }), '3e+3') @@ -201,6 +210,10 @@ describe('format', function () { it('should format positive uneven four digits to engineering notation', function () { assert.strictEqual(math.format(bignumber(3001), { notation: 'engineering' }), '3.001e+3') }) + it('should format a number without trailing zeros to engineering notation', function () { + assert.strictEqual(math.format(bignumber(3010), { notation: 'engineering' }), '3.01e+3') + assert.strictEqual(math.format(bignumber(452550000), { notation: 'engineering' }), '452.55e+6') + }) it('should format positive uneven ten digits to engineering notation', function () { assert.strictEqual(math.format(bignumber(3741293481), { notation: 'engineering' }), '3.741293481e+9') }) @@ -209,9 +222,12 @@ describe('format', function () { }) it('should format positive single digit floating point numbers to engineering notation', function () { assert.strictEqual(math.format(bignumber(0.1), { notation: 'engineering' }), '100e-3') + assert.strictEqual(math.format(bignumber(0.11), { notation: 'engineering' }), '110e-3') }) it('should format positive two digit floating point numbers to engineering notation', function () { assert.strictEqual(math.format(bignumber(0.01), { notation: 'engineering' }), '10e-3') + assert.strictEqual(math.format(bignumber(0.011), { notation: 'engineering' }), '11e-3') + assert.strictEqual(math.format(bignumber(0.0111), { notation: 'engineering' }), '11.1e-3') }) it('should format positive three digit floating point numbers to engineering notation', function () { assert.strictEqual(math.format(bignumber(0.003), { notation: 'engineering' }), '3e-3') diff --git a/test/unit-tests/function/utils/typeof.test.js b/test/unit-tests/function/utils/typeof.test.js index 83ed1a806e..312ee80ae1 100644 --- a/test/unit-tests/function/utils/typeof.test.js +++ b/test/unit-tests/function/utils/typeof.test.js @@ -2,6 +2,7 @@ import assert from 'assert' import math from '../../../../src/bundleAny' + const Index = math.Index const Range = math.Range const Help = math.Help @@ -141,20 +142,4 @@ describe('typeOf', function () { assert.throws(function () { math.typeOf() }, /Too few arguments in function typeOf/) assert.throws(function () { math.typeOf(1, 2, 3) }, /Too many arguments in function typeOf/) }) - - it('should still allow using the deprecated function math.typeof', () => { - // deprecated in v6.0.0. Clean up some day - const warnOriginal = console.warn - const logs = [] - console.warn = (...args) => logs.push(args) - - assert.strictEqual(math.typeof(true), 'boolean') - - // Note that the following assertion will fail if math.typeof is already used in a previous unit test - assert.deepStrictEqual(logs, [ - ['Warning:', 'Function "typeof" has been renamed to "typeOf" in v6.0.0, please use the new function instead.'] - ]) - - console.warn = warnOriginal - }) }) diff --git a/test/unit-tests/json/replacer.test.js b/test/unit-tests/json/replacer.test.js index 430e9f29fd..8a96589e8a 100644 --- a/test/unit-tests/json/replacer.test.js +++ b/test/unit-tests/json/replacer.test.js @@ -1,11 +1,20 @@ import assert from 'assert' import math from '../../../src/bundleAny' +const replacer = math.replacer describe('replacer', function () { it('should stringify generic JSON', function () { const data = { foo: [1, 2, 3], bar: null, baz: 'str' } const json = '{"foo":[1,2,3],"bar":null,"baz":"str"}' assert.deepStrictEqual(JSON.stringify(data), json) + assert.deepStrictEqual(JSON.stringify(data, replacer), json) + }) + + it('should stringify a number with special values like Infinity', function () { + assert.deepStrictEqual(JSON.stringify(2.3, replacer), '2.3') + assert.deepStrictEqual(JSON.stringify(Infinity, replacer), '{"mathjs":"number","value":"Infinity"}') + assert.deepStrictEqual(JSON.stringify(-Infinity, replacer), '{"mathjs":"number","value":"-Infinity"}') + assert.deepStrictEqual(JSON.stringify(NaN, replacer), '{"mathjs":"number","value":"NaN"}') }) it('should stringify a Complex number', function () { @@ -13,6 +22,7 @@ describe('replacer', function () { const json = '{"mathjs":"Complex","re":2,"im":4}' assert.deepStrictEqual(JSON.stringify(c), json) + assert.deepStrictEqual(JSON.stringify(c, replacer), json) }) it('should stringify a BigNumber', function () { @@ -20,6 +30,7 @@ describe('replacer', function () { const json = '{"mathjs":"BigNumber","value":"5"}' assert.deepStrictEqual(JSON.stringify(b), json) + assert.deepStrictEqual(JSON.stringify(b, replacer), json) }) it('should stringify a Fraction', function () { @@ -27,12 +38,14 @@ describe('replacer', function () { const json = '{"mathjs":"Fraction","n":3,"d":8}' assert.deepStrictEqual(JSON.stringify(b), json) + assert.deepStrictEqual(JSON.stringify(b, replacer), json) }) it('should stringify a Range', function () { const r = new math.Range(2, 10) const json = '{"mathjs":"Range","start":2,"end":10,"step":1}' assert.deepStrictEqual(JSON.stringify(r), json) + assert.deepStrictEqual(JSON.stringify(r, replacer), json) }) it('should stringify an Index', function () { @@ -42,18 +55,21 @@ describe('replacer', function () { '{"mathjs":"ImmutableDenseMatrix","data":[2],"size":[1]}' + ']}' assert.deepStrictEqual(JSON.stringify(i), json) + assert.deepStrictEqual(JSON.stringify(i, replacer), json) }) it('should stringify a Range (2)', function () { const r = new math.Range(2, 10, 2) const json = '{"mathjs":"Range","start":2,"end":10,"step":2}' assert.deepStrictEqual(JSON.stringify(r), json) + assert.deepStrictEqual(JSON.stringify(r, replacer), json) }) it('should stringify a Unit', function () { const u = new math.Unit(5, 'cm') const json = '{"mathjs":"Unit","value":5,"unit":"cm","fixPrefix":false}' assert.deepStrictEqual(JSON.stringify(u), json) + assert.deepStrictEqual(JSON.stringify(u, replacer), json) }) it('should stringify a Matrix, dense', function () { @@ -61,6 +77,7 @@ describe('replacer', function () { const json = '{"mathjs":"DenseMatrix","data":[[1,2],[3,4]],"size":[2,2]}' assert.deepStrictEqual(JSON.stringify(m), json) + assert.deepStrictEqual(JSON.stringify(m, replacer), json) }) it('should stringify a Matrix, sparse', function () { @@ -68,12 +85,14 @@ describe('replacer', function () { const json = '{"mathjs":"SparseMatrix","values":[1,3,2,4],"index":[0,1,0,1],"ptr":[0,2,4],"size":[2,2]}' assert.deepStrictEqual(JSON.stringify(m), json) + assert.deepStrictEqual(JSON.stringify(m, replacer), json) }) it('should stringify a ResultSet', function () { const r = new math.ResultSet([1, 2, new math.Complex(3, 4)]) const json = '{"mathjs":"ResultSet","entries":[1,2,{"mathjs":"Complex","re":3,"im":4}]}' assert.deepStrictEqual(JSON.stringify(r), json) + assert.deepStrictEqual(JSON.stringify(r, replacer), json) }) it('should stringify a Matrix containing a complex number, dense', function () { @@ -82,6 +101,7 @@ describe('replacer', function () { const json = '{"mathjs":"DenseMatrix","data":[[1,2],[3,{"mathjs":"Complex","re":4,"im":5}]],"size":[2,2]}' assert.deepStrictEqual(JSON.stringify(m), json) + assert.deepStrictEqual(JSON.stringify(m, replacer), json) }) it('should stringify a Matrix containing a complex number, sparse', function () { @@ -90,12 +110,14 @@ describe('replacer', function () { const json = '{"mathjs":"SparseMatrix","values":[1,3,2,{"mathjs":"Complex","re":4,"im":5}],"index":[0,1,0,1],"ptr":[0,2,4],"size":[2,2]}' assert.deepStrictEqual(JSON.stringify(m), json) + assert.deepStrictEqual(JSON.stringify(m, replacer), json) }) it('should stringify a Chain', function () { const c = math.chain(2.3) const json = '{"mathjs":"Chain","value":2.3}' assert.deepStrictEqual(JSON.stringify(c), json) + assert.deepStrictEqual(JSON.stringify(c, replacer), json) }) it('should stringify a node tree', function () { @@ -139,11 +161,13 @@ describe('replacer', function () { } assert.deepStrictEqual(JSON.parse(JSON.stringify(node)), json) + assert.deepStrictEqual(JSON.parse(JSON.stringify(node, replacer)), json) }) it('should stringify Help', function () { const h = new math.Help({ name: 'foo', description: 'bar' }) const json = '{"mathjs":"Help","name":"foo","description":"bar"}' assert.deepStrictEqual(JSON.parse(JSON.stringify(h)), JSON.parse(json)) + assert.deepStrictEqual(JSON.parse(JSON.stringify(h, replacer)), JSON.parse(json)) }) }) diff --git a/test/unit-tests/json/reviver.test.js b/test/unit-tests/json/reviver.test.js index 0f0d6d9816..cad25b412b 100644 --- a/test/unit-tests/json/reviver.test.js +++ b/test/unit-tests/json/reviver.test.js @@ -10,6 +10,14 @@ describe('reviver', function () { assert.deepStrictEqual(JSON.parse(json, reviver), data) }) + it('should parse a stringified numbers', function () { + assert.strictEqual(JSON.parse('2.3', reviver), 2.3) + assert.strictEqual(JSON.parse('{"mathjs":"number","value":"2.3"}', reviver), 2.3) + assert.strictEqual(JSON.parse('{"mathjs":"number","value":"Infinity"}', reviver), Infinity) + assert.strictEqual(JSON.parse('{"mathjs":"number","value":"-Infinity"}', reviver), -Infinity) + assert(isNaN(JSON.parse('{"mathjs":"number","value":"NaN"}', reviver))) + }) + it('should parse a stringified complex number', function () { const json = '{"mathjs":"Complex","re":2,"im":4}' const c = new math.Complex(2, 4) diff --git a/test/unit-tests/test.html b/test/unit-tests/test.html index 5a0e961010..4b2c0de12c 100644 --- a/test/unit-tests/test.html +++ b/test/unit-tests/test.html @@ -6,8 +6,8 @@ - - + + @@ -61,4 +61,4 @@ - \ No newline at end of file + diff --git a/test/unit-tests/test.min.html b/test/unit-tests/test.min.html index 64a9f1ade2..bd74ead9ce 100644 --- a/test/unit-tests/test.min.html +++ b/test/unit-tests/test.min.html @@ -3,7 +3,7 @@ mathjs test - +

@@ -28,4 +28,4 @@ - \ No newline at end of file + diff --git a/test/unit-tests/type/matrix/DenseMatrix.test.js b/test/unit-tests/type/matrix/DenseMatrix.test.js index 8e76c9d382..37a417bfe9 100644 --- a/test/unit-tests/type/matrix/DenseMatrix.test.js +++ b/test/unit-tests/type/matrix/DenseMatrix.test.js @@ -301,6 +301,18 @@ describe('DenseMatrix', function () { assert.deepStrictEqual(m.valueOf(), []) }) + it('should resize the matrix with DenseMatrix as input', function () { + const m = new DenseMatrix([[1, 2, 3], [4, 5, 6]]) + m.resize(new DenseMatrix([2, 4])) + assert.deepStrictEqual(m.valueOf(), [[1, 2, 3, 0], [4, 5, 6, 0]]) + }) + + it('should resize the matrix with SparseMatrix as input', function () { + const m = new DenseMatrix([[1, 2, 3], [4, 5, 6]]) + m.resize(new SparseMatrix([2, 4])) + assert.deepStrictEqual(m.valueOf(), [[1, 2, 3, 0], [4, 5, 6, 0]]) + }) + it('should resize the matrix with null default value', function () { const m = new DenseMatrix([]) m.resize([3], null) diff --git a/test/unit-tests/type/matrix/SparseMatrix.test.js b/test/unit-tests/type/matrix/SparseMatrix.test.js index 4b6dc5cb30..e68ace932d 100644 --- a/test/unit-tests/type/matrix/SparseMatrix.test.js +++ b/test/unit-tests/type/matrix/SparseMatrix.test.js @@ -367,6 +367,26 @@ describe('SparseMatrix', function () { ]) }) + it('should resize using SparseMatrix input', function () { + const m = new SparseMatrix( + [ + [1, 2, 3], + [4, 5, 6] + ]) + m.resize(new SparseMatrix([2, 4])) + assert.deepStrictEqual(m._size, [2, 4]) + }) + + it('should resize using DenseMatrix input', function () { + const m = new SparseMatrix( + [ + [1, 2, 3], + [4, 5, 6] + ]) + m.resize(new DenseMatrix([2, 4])) + assert.deepStrictEqual(m._size, [2, 4]) + }) + it('should increase columns as needed, non zero value', function () { const m = new SparseMatrix( [ diff --git a/test/unit-tests/type/unit/Unit.test.js b/test/unit-tests/type/unit/Unit.test.js index 037b7ad771..417a406960 100644 --- a/test/unit-tests/type/unit/Unit.test.js +++ b/test/unit-tests/type/unit/Unit.test.js @@ -2,6 +2,7 @@ import assert from 'assert' import approx from '../../../../tools/approx' import math from '../../../../src/bundleAny' import { isBigNumber, isFraction } from '../../../../src/utils/is' +import { hasOwnProperty } from '../../../../src/utils/object' const Unit = math.Unit @@ -231,6 +232,11 @@ describe('Unit', function () { const u = new Unit(math.fraction(5), 'cm') assert.strictEqual(u.toNumber('mm'), 50) }) + + it('should convert a unit with value only to a number', function () { + const u = Unit.parse('5', { allowNoUnits: true }) + assert.strictEqual(u.toNumber(), 5) + }) }) describe('toNumeric', function () { @@ -349,6 +355,11 @@ describe('Unit', function () { assert.strictEqual(u4.fixPrefix, true) }) + it('should convert a unitless quantity', function () { + const u = Unit.parse('5', { allowNoUnits: true }) + assert.strictEqual(u.toNumeric(), 5) + }) + it('should convert a binary prefixes (1)', function () { const u1 = new Unit(1, 'Kib') assert.strictEqual(u1.value, 1024) @@ -1050,7 +1061,9 @@ describe('Unit', function () { it("For each built-in unit, 'name' should match key", function () { for (const key in Unit.UNITS) { - assert.strictEqual(key, Unit.UNITS[key].name) + if (hasOwnProperty(Unit.UNITS, key)) { + assert.strictEqual(key, Unit.UNITS[key].name) + } } }) }) diff --git a/tools/docgenerator.js b/tools/docgenerator.js index 6681f6449b..baeb866718 100644 --- a/tools/docgenerator.js +++ b/tools/docgenerator.js @@ -65,17 +65,29 @@ const IGNORE_WARNINGS = { */ function generateDoc (name, code) { // get block comment from code - const match = /\/\*\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\//.exec(code) + const commentRegex = /\/\*\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\//g + // const match = commentRegex.exec(code) - if (!match) { + const comments = findAll(code, commentRegex).map(match => getCommentContents(match[0])) + + // Find the right comment. + // First search a comment containing the text "Syntax:" and "Examples:". + // If not found, select the first comment + const comment = comments.find(comment => { + return /\n *syntax: *\n/i.exec(comment) && /\n *examples: *\n/i.exec(comment) + }) || comments[0] + + if (!comment) { return null } // get text content inside block comment - const comment = match[0].replace('/**', '') - .replace('*/', '') - .replace(/\n\s*\* ?/g, '\n') - .replace(/\r/g, '') + function getCommentContents (comment) { + return comment.replace('/**', '') + .replace('*/', '') + .replace(/\n\s*\* ?/g, '\n') + .replace(/\r/g, '') + } const lines = comment.split('\n') let line = '' @@ -512,10 +524,10 @@ function iteratePath (functionNames, inputPath, outputPath, outputRoot) { } else { category = path[functionIndex + 1] } - } else if (fullPath === './lib/expression/parse.js') { + } else if (fullPath === './lib/cjs/expression/parse.js') { // TODO: this is an ugly special case category = 'expression' - } else if (path.join('/') === './lib/type') { + } else if (path.join('/') === './lib/cjs/type') { // for boolean.js, number.js, string.js category = 'construction' } @@ -634,6 +646,20 @@ function iteratePath (functionNames, inputPath, outputPath, outputRoot) { }) } +function findAll (text, regex) { + const matches = [] + let match + + do { + match = regex.exec(text) + if (match) { + matches.push(match) + } + } while (match) + + return matches +} + // exports exports.cleanup = cleanup exports.iteratePath = iteratePath diff --git a/tools/entryGenerator.js b/tools/entryGenerator.js index e59c19459c..346a794109 100644 --- a/tools/entryGenerator.js +++ b/tools/entryGenerator.js @@ -38,7 +38,7 @@ const dependenciesIndexTemplate = Handlebars.compile(`/** * DON'T MAKE CHANGES HERE */ {{#factories}} -export { {{name}} } from '{{fileName}}'{{eslintComment}} +export { {{name}} } from '{{fileName}}.js'{{eslintComment}} {{/factories}} export { all } from './allFactories{{suffix}}.js' @@ -49,7 +49,7 @@ const dependenciesFileTemplate = Handlebars.compile(`/** * DON'T MAKE CHANGES HERE */ {{#dependencies}} -import { {{name}} } from '{{fileName}}' +import { {{name}} } from '{{fileName}}.js' {{/dependencies}} import { {{factoryName}} } from '../../factories{{suffix}}.js'{{eslintComment}} @@ -65,12 +65,12 @@ const pureFunctionsTemplate = Handlebars.compile(`/** * THIS FILE IS AUTO-GENERATED * DON'T MAKE CHANGES HERE */ -import { config } from './configReadonly' +import { config } from './configReadonly.js' import { {{#pureFactories}} {{factoryName}}{{#unless @last}},{{/unless}}{{eslintComment}} {{/pureFactories}} -} from '../factories{{suffix}}' +} from '../factories{{suffix}}.js' {{#pureFactories}} export const {{name}} = /* #__PURE__ */ {{factoryName ~}} @@ -86,7 +86,7 @@ const impureFunctionsTemplate = Handlebars.compile(`/** * THIS FILE IS AUTO-GENERATED * DON'T MAKE CHANGES HERE */ -import { config } from './configReadonly' +import { config } from './configReadonly.js' import { {{#impureFactories}} {{factoryName}},{{eslintComment}} @@ -94,12 +94,12 @@ import { {{#transformFactories}} {{factoryName}}{{#unless @last}},{{/unless}}{{eslintComment}} {{/transformFactories}} -} from '../factories{{suffix}}' +} from '../factories{{suffix}}.js' import { {{#pureFactories}} {{name}}{{#unless @last}},{{/unless}}{{eslintComment}} {{/pureFactories}} -} from './pureFunctions{{suffix}}.generated' +} from './pureFunctions{{suffix}}.generated.js' const math = {} // NOT pure! const mathWithTransform = {} // NOT pure! @@ -146,12 +146,12 @@ Object.assign(classes, { Chain.createProxy(math) -export { embeddedDocs as docs } from '../expression/embeddedDocs/embeddedDocs' +export { embeddedDocs as docs } from '../expression/embeddedDocs/embeddedDocs.js' `) exports.generateEntryFiles = function () { - const factoriesAny = require('../lib/factoriesAny') - const factoriesNumber = require('../lib/factoriesNumber') + const factoriesAny = require('../lib/cjs/factoriesAny') + const factoriesNumber = require('../lib/cjs/factoriesNumber') generateDependenciesFiles({ suffix: 'Any', diff --git a/tools/matrixmarket.js b/tools/matrixmarket.js index 4bb3a327d7..b9f1a0283e 100644 --- a/tools/matrixmarket.js +++ b/tools/matrixmarket.js @@ -1,6 +1,6 @@ const fs = require('fs') const typed = require('typed-function') -const math = require('../lib/bundleAny') +const math = require('../lib/cjs/bundleAny') const Spa = math.Spa const DenseMatrix = math.DenseMatrix const SparseMatrix = math.SparseMatrix diff --git a/tools/package.json b/tools/package.json new file mode 100644 index 0000000000..5bbefffbab --- /dev/null +++ b/tools/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tools/update-authors.js b/tools/update-authors.js new file mode 100644 index 0000000000..17dac727cd --- /dev/null +++ b/tools/update-authors.js @@ -0,0 +1,105 @@ +#!/usr/bin/env node + +// Attribution: +// This file is based on https://github.com/nodejs/node/blob/master/tools/update-authors.js. +// It is licensed according to https://github.com/nodejs/node/blob/master/LICENSE + +// Usage: tools/update-author.js [--dry] +// Passing --dry will redirect output to stdout rather than write to 'AUTHORS'. + +'use strict' +const { spawn } = require('child_process') +const path = require('path') +const fs = require('fs') +const readline = require('readline') + +class CaseIndifferentMap { + constructor () { + this._map = new Map() + } + + get (key) { return this._map.get(key.toLowerCase()) } + set (key, value) { return this._map.set(key.toLowerCase(), value) } +} + +const log = spawn( + 'git', + // Inspect author name/email and body. + ['log', '--reverse', '--format=Author: %aN <%aE>\n%b'], { + stdio: ['inherit', 'pipe', 'inherit'] + }) +const rl = readline.createInterface({ input: log.stdout }) + +let output +if (process.argv.includes('--dry')) { output = process.stdout } else { output = fs.createWriteStream('AUTHORS') } + +output.write('# Authors ordered by first contribution.\n\n') + +const mailmap = new CaseIndifferentMap() +{ + const lines = fs.readFileSync(path.resolve(__dirname, '../', '.mailmap'), + { encoding: 'utf8' }).split('\n') + for (let line of lines) { + line = line.trim() + if (line.startsWith('#') || line === '') continue + + // Replaced Name + const match1 = line.match(/^([^<]+)\s+(<[^>]+>)$/) + if (match1) { + mailmap.set(match1[2], { author: match1[1] }) + continue + } + // + const match2 = line.match(/^<([^>]+)>\s+(<[^>]+>)$/) + if (match2) { + mailmap.set(match2[2], { email: match2[1] }) + continue + } + // Replaced Name + const match3 = line.match(/^([^<]+)\s+(<[^>]+>)\s+(<[^>]+>)$/) + if (match3) { + mailmap.set(match3[3], { + author: match3[1], email: match3[2] + }) + continue + } + // Replaced Name Original Name + const match4 = line.match(/^([^<]+)\s+(<[^>]+>)\s+([^<]+)\s+(<[^>]+>)$/) + if (match4) { + mailmap.set(match4[3] + '\0' + match4[4], { + author: match4[1], email: match4[2] + }) + continue + } + console.warn('Unknown .mailmap format:', line) + } +} + +const seen = new Set() + +// Support regular git author metadata, as well as `Author:` and +// `Co-authored-by:` in the message body. Both have been used in the past +// to indicate multiple authors per commit, with the latter standardized +// by GitHub now. +const authorRe = + /(^Author:|^Co-authored-by:)\s+(?[^<]+)\s+(?<[^>]+>)/i +rl.on('line', (line) => { + const match = line.match(authorRe) + if (!match) return + + const { author, email } = match.groups + + if (seen.has(email) || + /@chromium\.org/.test(email) || + /greenkeeper\[bot\]/.test(email) || + email === '') { + return + } + + seen.add(email) + output.write(`${author} ${email}\n`) +}) + +rl.on('close', () => { + output.end('\n# Generated by tools/update-authors.js\n') +})