diff --git a/bin/cli.js b/bin/cli.js index 9801a1620..f61e79f01 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -96,7 +96,7 @@ function completer (text) { // scope variables for (const def in scope) { - if (scope.hasOwnProperty(def)) { + if (hasOwnProperty(scope, def)) { if (def.indexOf(keyword) === 0) { matches.push(def) } @@ -113,7 +113,7 @@ function completer (text) { // math functions and constants const ignore = ['expr', 'type'] for (const func in math.expression.mathWithTransform) { - if (math.expression.mathWithTransform.hasOwnProperty(func)) { + if (hasOwnProperty(math.expression.mathWithTransform, func)) { if (func.indexOf(keyword) === 0 && ignore.indexOf(func) === -1) { matches.push(func) } @@ -122,24 +122,24 @@ function completer (text) { // units const Unit = math.Unit - for (let name in Unit.UNITS) { - if (Unit.UNITS.hasOwnProperty(name)) { + for (const name in Unit.UNITS) { + if (hasOwnProperty(Unit.UNITS, name)) { if (name.indexOf(keyword) === 0) { matches.push(name) } } } - for (let name in Unit.PREFIXES) { - if (Unit.PREFIXES.hasOwnProperty(name)) { + for (const name in Unit.PREFIXES) { + if (hasOwnProperty(Unit.PREFIXES, name)) { const prefixes = Unit.PREFIXES[name] for (const prefix in prefixes) { - if (prefixes.hasOwnProperty(prefix)) { + if (hasOwnProperty(prefixes, prefix)) { if (prefix.indexOf(keyword) === 0) { matches.push(prefix) } else if (keyword.indexOf(prefix) === 0) { const unitKeyword = keyword.substring(prefix.length) for (const n in Unit.UNITS) { - if (Unit.UNITS.hasOwnProperty(n)) { + if (hasOwnProperty(Unit.UNITS, n)) { if (n.indexOf(unitKeyword) === 0 && Unit.isValuelessUnit(prefix + n)) { matches.push(prefix + n) @@ -424,3 +424,9 @@ if (version) { } }) } + +// helper function to safely check whether an object as a property +// copy from the function in object.js which is ES6 +function hasOwnProperty (object, property) { + return object && Object.hasOwnProperty.call(object, property) +} diff --git a/examples/advanced/custom_argument_parsing.js b/examples/advanced/custom_argument_parsing.js index 752eb7f98..7b66e85f9 100644 --- a/examples/advanced/custom_argument_parsing.js +++ b/examples/advanced/custom_argument_parsing.js @@ -93,6 +93,6 @@ console.log(math.integrate(f, 0, 1)) // outputs 0.6667254718034714 console.log(math.evaluate('integrate(x^0.5, x, 0, 1)')) // outputs 0.6667254718034714 // use the function via the expression parser (2) -let scope = {} +const scope = {} math.evaluate('f(x) = 2 * x', scope) console.log(math.evaluate('integrate(f(x), x, 0, 2)', scope)) // outputs 4.000000000000003 diff --git a/examples/advanced/more_secure_eval.js b/examples/advanced/more_secure_eval.js index 1d89a85ec..46329ba7c 100644 --- a/examples/advanced/more_secure_eval.js +++ b/examples/advanced/more_secure_eval.js @@ -24,12 +24,12 @@ const math = create(all) const limitedEvaluate = math.evaluate math.import({ - 'import': function () { throw new Error('Function import is disabled') }, - 'createUnit': function () { throw new Error('Function createUnit is disabled') }, - 'evaluate': function () { throw new Error('Function evaluate is disabled') }, - 'parse': function () { throw new Error('Function parse is disabled') }, - 'simplify': function () { throw new Error('Function simplify is disabled') }, - 'derivative': function () { throw new Error('Function derivative is disabled') } + import: function () { throw new Error('Function import is disabled') }, + createUnit: function () { throw new Error('Function createUnit is disabled') }, + evaluate: function () { throw new Error('Function evaluate is disabled') }, + parse: function () { throw new Error('Function parse is disabled') }, + simplify: function () { throw new Error('Function simplify is disabled') }, + derivative: function () { throw new Error('Function derivative is disabled') } }, { override: true }) console.log(limitedEvaluate('sqrt(16)')) // Ok, 4 diff --git a/examples/advanced/web_server/math_worker.js b/examples/advanced/web_server/math_worker.js index 878d2ac3f..2c7c0baa4 100644 --- a/examples/advanced/web_server/math_worker.js +++ b/examples/advanced/web_server/math_worker.js @@ -6,7 +6,7 @@ const math = create(all) function noImport () { throw new Error('function import is disabled.') } -math.import({ 'import': noImport }, { override: true }) +math.import({ import: noImport }, { override: true }) /** * Evaluate an expression diff --git a/examples/expressions.js b/examples/expressions.js index a20ac9388..60f4ccbc0 100644 --- a/examples/expressions.js +++ b/examples/expressions.js @@ -36,7 +36,7 @@ print(math.evaluate([ // provide a scope (just a regular JavaScript Object) console.log('\nevaluate expressions providing a scope with variables and functions') -let scope = { +const scope = { a: 3, b: 4 } @@ -84,7 +84,7 @@ console.log('\nprovide a scope') const node2 = math.parse('x^a') const code2 = node2.compile() print(node2.toString()) // "x ^ a" -let scope2 = { +const scope2 = { x: 3, a: 2 } @@ -115,7 +115,7 @@ print(code3.evaluate()) // 5 // provide a scope for the variable assignment console.log('\nprovide a scope') const code4 = math.compile('a = a + 3') -let scope3 = { +const scope3 = { a: 7 } code4.evaluate(scope3) diff --git a/examples/objects.js b/examples/objects.js index afcc98074..5140ac229 100644 --- a/examples/objects.js +++ b/examples/objects.js @@ -10,7 +10,7 @@ print(evaluate('{"name": "John"}')) // {"name": "John"} // create an object containing an object print(evaluate('{a: 2, b: {c: 3, d: 4}}')) // {"a": 2, "b": {"c": 3, "d": 4}} -let scope = { +const scope = { obj: { prop: 42 } diff --git a/gulpfile.js b/gulpfile.js index e0a4dc604..d11b4c161 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -169,8 +169,6 @@ function minify (done) { log('Minified ' + FILE_MIN) log('Mapped ' + FILE_MAP) - } catch (e) { - throw e } finally { process.chdir(oldCwd) } diff --git a/package-lock.json b/package-lock.json index 676baf4ea..6adaa8c22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", "dev": true, "requires": { "@babel/highlight": "^7.0.0" @@ -33,81 +33,17 @@ "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" - }, - "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==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/generator": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.5.tgz", - "integrity": "sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ==", - "dev": true, - "requires": { - "@babel/types": "^7.5.5", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - } - }, - "@babel/parser": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", - "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", - "dev": true - }, - "@babel/traverse": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz", - "integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.5.5", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.5.5", - "@babel/types": "^7.5.5", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", - "dev": true - } } }, "@babel/generator": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz", - "integrity": "sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.5.tgz", + "integrity": "sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ==", "dev": true, "requires": { - "@babel/types": "^7.4.4", + "@babel/types": "^7.5.5", "jsesc": "^2.5.1", - "lodash": "^4.17.11", + "lodash": "^4.17.13", "source-map": "^0.5.0", "trim-right": "^1.0.1" } @@ -151,25 +87,6 @@ "@babel/helper-function-name": "^7.1.0", "@babel/types": "^7.5.5", "lodash": "^4.17.13" - }, - "dependencies": { - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", - "dev": true - } } }, "@babel/helper-explode-assignable-expression": { @@ -218,25 +135,6 @@ "dev": true, "requires": { "@babel/types": "^7.5.5" - }, - "dependencies": { - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", - "dev": true - } } }, "@babel/helper-module-imports": { @@ -260,25 +158,6 @@ "@babel/template": "^7.4.4", "@babel/types": "^7.5.5", "lodash": "^4.17.13" - }, - "dependencies": { - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", - "dev": true - } } }, "@babel/helper-optimise-call-expression": { @@ -303,14 +182,6 @@ "dev": true, "requires": { "lodash": "^4.17.13" - }, - "dependencies": { - "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", - "dev": true - } } }, "@babel/helper-remap-async-to-generator": { @@ -336,70 +207,6 @@ "@babel/helper-optimise-call-expression": "^7.0.0", "@babel/traverse": "^7.5.5", "@babel/types": "^7.5.5" - }, - "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==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/generator": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.5.tgz", - "integrity": "sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ==", - "dev": true, - "requires": { - "@babel/types": "^7.5.5", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - } - }, - "@babel/parser": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", - "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", - "dev": true - }, - "@babel/traverse": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz", - "integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.5.5", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.5.5", - "@babel/types": "^7.5.5", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", - "dev": true - } } }, "@babel/helper-simple-access": { @@ -442,76 +249,12 @@ "@babel/template": "^7.4.4", "@babel/traverse": "^7.5.5", "@babel/types": "^7.5.5" - }, - "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==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/generator": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.5.tgz", - "integrity": "sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ==", - "dev": true, - "requires": { - "@babel/types": "^7.5.5", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - } - }, - "@babel/parser": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", - "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", - "dev": true - }, - "@babel/traverse": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz", - "integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.5.5", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.5.5", - "@babel/types": "^7.5.5", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", - "dev": true - } } }, "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", "dev": true, "requires": { "chalk": "^2.0.0", @@ -520,9 +263,9 @@ } }, "@babel/parser": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.5.tgz", - "integrity": "sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", + "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", "dev": true }, "@babel/plugin-proposal-async-generator-functions": { @@ -669,14 +412,6 @@ "requires": { "@babel/helper-plugin-utils": "^7.0.0", "lodash": "^4.17.13" - }, - "dependencies": { - "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", - "dev": true - } } }, "@babel/plugin-transform-classes": { @@ -1013,25 +748,6 @@ "invariant": "^2.2.2", "js-levenshtein": "^1.1.3", "semver": "^5.5.0" - }, - "dependencies": { - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", - "dev": true - } } }, "@babel/register": { @@ -1046,14 +762,6 @@ "mkdirp": "^0.5.1", "pirates": "^4.0.0", "source-map-support": "^0.5.9" - }, - "dependencies": { - "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", - "dev": true - } } }, "@babel/template": { @@ -1068,30 +776,30 @@ } }, "@babel/traverse": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.5.tgz", - "integrity": "sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz", + "integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.4.4", + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.5.5", "@babel/helper-function-name": "^7.1.0", "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.4.5", - "@babel/types": "^7.4.4", + "@babel/parser": "^7.5.5", + "@babel/types": "^7.5.5", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.11" + "lodash": "^4.17.13" } }, "@babel/types": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz", - "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", + "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", "dev": true, "requires": { "esutils": "^2.0.2", - "lodash": "^4.17.11", + "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } }, @@ -1145,9 +853,9 @@ "dev": true }, "@types/node": { - "version": "12.0.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.10.tgz", - "integrity": "sha512-LcsGbPomWsad6wmMNv7nBLw7YYYyfdYcz6xryKYQhx89c3XXan+8Q6AJ43G5XDIaklaVkK3mE4fCb0SBvMiPSQ==", + "version": "12.6.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.6.8.tgz", + "integrity": "sha512-aX+gFgA5GHcDi89KG5keey2zf0WfZk/HAQotEamsK2kbey+8yGKcson0hbK8E+v0NArlCJQCqMP161YhV6ZXLg==", "dev": true }, "@webassemblyjs/ast": { @@ -1355,9 +1063,9 @@ } }, "acorn": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", - "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.2.0.tgz", + "integrity": "sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw==", "dev": true }, "acorn-jsx": { @@ -1382,9 +1090,9 @@ } }, "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -1400,9 +1108,9 @@ "dev": true }, "ajv-keywords": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.0.tgz", - "integrity": "sha512-aUjdRFISbuFOl0EIZc+9e4FfZp0bDZgAdOOf30bJmw8VM9v84SHyVyxDfbWxpGYbdZD/9XoKxfHVNmxPkhwyGw==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", + "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", "dev": true }, "amdefine": { @@ -1465,6 +1173,111 @@ "requires": { "micromatch": "^3.1.4", "normalize-path": "^2.1.1" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } } }, "append-buffer": { @@ -1686,6 +1499,12 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", @@ -1731,50 +1550,6 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, "babel-loader": { "version": "8.0.6", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.6.tgz", @@ -1999,32 +1774,12 @@ } }, "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "fill-range": "^7.0.1" } }, "brorand": { @@ -2280,15 +2035,6 @@ "write-file-atomic": "^2.4.2" } }, - "caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", - "dev": true, - "requires": { - "callsites": "^0.2.0" - } - }, "callsite": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", @@ -2296,9 +2042,9 @@ "dev": true }, "callsites": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, "camelcase": { @@ -2325,9 +2071,9 @@ } }, "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "chokidar": { @@ -2350,11 +2096,99 @@ "upath": "^1.1.1" }, "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, "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 + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } } } }, @@ -2383,12 +2217,6 @@ "safe-buffer": "^5.0.1" } }, - "circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", - "dev": true - }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -2700,9 +2528,9 @@ } }, "core-js": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.1.3.tgz", - "integrity": "sha512-PWZ+ZfuaKf178BIAg+CRsljwjIMRV8MY00CbZczkR6Zk5LfkSkjGoaab3+bqRQWVITNZxQB7TFYz+CFcyuamvA==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.1.4.tgz", + "integrity": "sha512-YNZN8lt82XIMLnLirj9MhKDFZHalwzzrL9YLt6eb0T5D0EDl4IQ90IGkua8mHbnxNrkj1d8hbdizMc0Qmg1WnQ==", "dev": true }, "core-js-compat": { @@ -2840,18 +2668,19 @@ "dev": true }, "d": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", "dev": true, "requires": { - "es5-ext": "^0.10.9" + "es5-ext": "^0.10.50", + "type": "^1.0.1" } }, "date-format": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.0.0.tgz", - "integrity": "sha512-M6UqVvZVgFYqZL1SfHsRGIQSz3ZL+qgbsV5Lp1Vj61LZVYuEwcMXYay7DRDtYs2HQQBK5hQtQ0fD9aEJ89V0LA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.1.0.tgz", + "integrity": "sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA==", "dev": true }, "date-now": { @@ -2989,25 +2818,17 @@ } }, "deglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/deglob/-/deglob-2.1.1.tgz", - "integrity": "sha512-2kjwuGGonL7gWE1XU4Fv79+vVzpoQCl0V+boMwWtOQJV2AGDabCwez++nB1Nli/8BabAfZQ/UuHPlp6AymKdWw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/deglob/-/deglob-3.1.0.tgz", + "integrity": "sha512-al10l5QAYaM/PeuXkAr1Y9AQz0LCtWsnJG23pIgh44hDxHFOj36l6qvhfjnIWBYwZOqM1fXUFV9tkjL7JPdGvw==", "dev": true, "requires": { "find-root": "^1.0.0", "glob": "^7.0.5", - "ignore": "^3.0.9", + "ignore": "^5.0.0", "pkg-config": "^1.1.0", "run-parallel": "^1.1.2", "uniq": "^1.0.1" - }, - "dependencies": { - "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", - "dev": true - } } }, "del": { @@ -3075,20 +2896,12 @@ "dev": true, "requires": { "path-type": "^4.0.0" - }, - "dependencies": { - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - } } }, "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { "esutils": "^2.0.2" @@ -3153,9 +2966,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.193", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.193.tgz", - "integrity": "sha512-WX01CG1UoPtTUFaKKwMn+u8nJ63loP6hNxePWtk1pN8ibWMyX1q6TiWPsz1ABBKXezvmaIdtP+0BwzjC1wyCaw==", + "version": "1.3.196", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.196.tgz", + "integrity": "sha512-NFGRHzY0x8yIUFnAthKxaOKe5q+c8jjvyQM2pMq2+59QORz8AN5+qXPJBwX05kz2uEtyraX2XxB0LPT+7EE6vw==", "dev": true }, "elliptic": { @@ -3460,48 +3273,46 @@ } }, "eslint": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.4.0.tgz", - "integrity": "sha512-UIpL91XGex3qtL6qwyCQJar2j3osKxK9e3ano3OcGEIRM4oWIpCkDg9x95AXEC2wMs7PnxzOkPZ2gq+tsMS9yg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.0.1.tgz", + "integrity": "sha512-DyQRaMmORQ+JsWShYsSg4OPTjY56u1nCjAmICrE8vLWqyLKxhFXOthwMj1SA8xwfrv0CofLNVnqbfyhwCkaO0w==", "dev": true, "requires": { - "ajv": "^6.5.0", - "babel-code-frame": "^6.26.0", + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", "chalk": "^2.1.0", "cross-spawn": "^6.0.5", - "debug": "^3.1.0", - "doctrine": "^2.1.0", - "eslint-scope": "^4.0.0", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", "eslint-utils": "^1.3.1", "eslint-visitor-keys": "^1.0.0", - "espree": "^4.0.0", + "espree": "^6.0.0", "esquery": "^1.0.1", "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", + "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", + "glob-parent": "^3.1.0", "globals": "^11.7.0", - "ignore": "^4.0.2", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^5.2.0", - "is-resolvable": "^1.1.0", - "js-yaml": "^3.11.0", + "inquirer": "^6.2.2", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", "progress": "^2.0.0", - "regexpp": "^2.0.0", - "require-uncached": "^1.0.3", - "semver": "^5.5.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", "strip-ansi": "^4.0.0", "strip-json-comments": "^2.0.1", - "table": "^4.0.3", + "table": "^5.2.3", "text-table": "^0.2.0" }, "dependencies": { @@ -3511,15 +3322,33 @@ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, "requires": { - "ms": "^2.1.1" + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } } }, + "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 + }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -3532,15 +3361,15 @@ } }, "eslint-config-standard": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz", - "integrity": "sha512-COUz8FnXhqFitYj4DTqHzidjIL/t4mumGZto5c7DrBpvWoie+Sn3P4sLEzUGeYhRElWuFEf8K1S1EfvD1vixCQ==", + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-13.0.1.tgz", + "integrity": "sha512-zLKp4QOgq6JFgRm1dDCVv1Iu0P5uZ4v5Wa4DTOkg2RFMxdCX/9Qf7lz9ezRj2dBRa955cWQF/O/LWEiYWAHbTw==", "dev": true }, "eslint-config-standard-jsx": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-6.0.2.tgz", - "integrity": "sha512-D+YWAoXw+2GIdbMBRAzWwr1ZtvnSf4n4yL0gKGg7ShUOGXkSOLerI17K4F6LdQMJPNMoWYqepzQD/fKY+tXNSg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-7.0.0.tgz", + "integrity": "sha512-OiKOF3MFVmWOCVfsi8GHlVorOEiBsPzAnUhM3c6HML94O2krbdQ/eMABySHgHHOIBYRls9sR9I3lo6O0vXhVEg==", "dev": true }, "eslint-import-resolver-node": { @@ -3571,9 +3400,9 @@ } }, "eslint-module-utils": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz", - "integrity": "sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw==", + "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==", "dev": true, "requires": { "debug": "^2.6.8", @@ -3660,21 +3489,22 @@ } }, "eslint-plugin-import": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz", - "integrity": "sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g==", + "version": "2.18.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz", + "integrity": "sha512-5ohpsHAiUBRNaBWAF08izwUGlbrJoJJ+W9/TBwsGoR1MnlgfwMIKrFeSjWbt6moabiXW9xNvtFz+97KHRfI4HQ==", "dev": true, "requires": { + "array-includes": "^3.0.3", "contains-path": "^0.1.0", - "debug": "^2.6.8", + "debug": "^2.6.9", "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.1", - "eslint-module-utils": "^2.2.0", - "has": "^1.0.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.3", + "eslint-import-resolver-node": "^0.3.2", + "eslint-module-utils": "^2.4.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.0", "read-pkg-up": "^2.0.0", - "resolve": "^1.6.0" + "resolve": "^1.11.0" }, "dependencies": { "debug": { @@ -3802,36 +3632,59 @@ } }, "eslint-plugin-node": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-7.0.1.tgz", - "integrity": "sha512-lfVw3TEqThwq0j2Ba/Ckn2ABdwmL5dkOgAux1rvOk6CO7A6yGyPI2+zIxN6FyNkp1X1X/BSvKOceD6mBWSj4Yw==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-9.1.0.tgz", + "integrity": "sha512-ZwQYGm6EoV2cfLpE1wxJWsfnKUIXfM/KM09/TlorkukgCAwmkgajEJnPCmyzoFPQQkmvo5DrW/nyKutNIw36Mw==", "dev": true, "requires": { - "eslint-plugin-es": "^1.3.1", + "eslint-plugin-es": "^1.4.0", "eslint-utils": "^1.3.1", - "ignore": "^4.0.2", + "ignore": "^5.1.1", "minimatch": "^3.0.4", - "resolve": "^1.8.1", - "semver": "^5.5.0" + "resolve": "^1.10.1", + "semver": "^6.1.0" + }, + "dependencies": { + "semver": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz", + "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==", + "dev": true + } } }, "eslint-plugin-promise": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.0.1.tgz", - "integrity": "sha512-Si16O0+Hqz1gDHsys6RtFRrW7cCTB6P7p3OJmKp3Y3dxpQE2qwOA7d3xnV+0mBmrPoi0RBnxlCKvqu70te6wjg==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz", + "integrity": "sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw==", "dev": true }, "eslint-plugin-react": { - "version": "7.11.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.11.1.tgz", - "integrity": "sha512-cVVyMadRyW7qsIUh3FHp3u6QHNhOgVrLQYdQEB1bPWBsgbNCHdFAeNMquBMCcZJu59eNthX053L70l7gRt4SCw==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.14.2.tgz", + "integrity": "sha512-jZdnKe3ip7FQOdjxks9XPN0pjUKZYq48OggNMd16Sk+8VXx6JOvXmlElxROCgp7tiUsTsze3jd78s/9AFJP2mA==", "dev": true, "requires": { "array-includes": "^3.0.3", "doctrine": "^2.1.0", "has": "^1.0.3", - "jsx-ast-utils": "^2.0.1", - "prop-types": "^15.6.2" + "jsx-ast-utils": "^2.1.0", + "object.entries": "^1.1.0", + "object.fromentries": "^2.0.0", + "object.values": "^1.1.0", + "prop-types": "^15.7.2", + "resolve": "^1.10.1" + }, + "dependencies": { + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + } } }, "eslint-plugin-standard": { @@ -3859,10 +3712,13 @@ } }, "eslint-utils": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", - "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", - "dev": true + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.0.tgz", + "integrity": "sha512-7ehnzPaP5IIEh1r1tkjuIrxqhNkzUJa9z3R92tLJdZIVdWaczEhr3EbhGtsMrVxi1KeR8qA7Off6SWc5WNQqyQ==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.0.0" + } }, "eslint-visitor-keys": { "version": "1.0.0", @@ -3871,12 +3727,12 @@ "dev": true }, "espree": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-4.1.0.tgz", - "integrity": "sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.0.0.tgz", + "integrity": "sha512-lJvCS6YbCn3ImT3yKkPe0+tJ+mH6ljhGNjHQH9mRtiO6gjhVAOhVXW1yjnwqGwTkK3bGbye+hb00nFNmu0l/1Q==", "dev": true, "requires": { - "acorn": "^6.0.2", + "acorn": "^6.0.7", "acorn-jsx": "^5.0.0", "eslint-visitor-keys": "^1.0.0" } @@ -4045,9 +3901,9 @@ } }, "expr-eval": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/expr-eval/-/expr-eval-1.2.2.tgz", - "integrity": "sha1-ixoWC4FOZ9p2UgB+JpNxSJUiHqA=", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/expr-eval/-/expr-eval-1.2.3.tgz", + "integrity": "sha512-HqfsCqw/ScM+CzJMfj2JYjiysgozJmDPDVax94T7o/yU7UwZ8icXAunNF23sOsd3CEf9Q4JdU8Vx6y7LIdGE0w==", "dev": true }, "extend": { @@ -4078,13 +3934,13 @@ } }, "external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", "tmp": "^0.0.33" } }, @@ -4172,9 +4028,9 @@ "dev": true }, "fast-glob": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.0.3.tgz", - "integrity": "sha512-scDJbDhN+6S4ELXzzN96Fqm5y1CMRn+Io3C4Go+n/gUKP+LW26Wma6IxLSsX2eAMBUOFmyHKDBrUSuoHsycQ5A==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.0.4.tgz", + "integrity": "sha512-wkIbV6qg37xTJwqSsdnIphL1e+LaGz4AIQqr00mIubMaEhv1/HEmJ0uuCGZRNRUkZZmOB5mJKO0ZUTVq+SxMQg==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.1", @@ -4183,60 +4039,6 @@ "is-glob": "^4.0.1", "merge2": "^1.2.3", "micromatch": "^4.0.2" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "glob-parent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz", - "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - } } }, "fast-json-stable-stringify": { @@ -4276,36 +4078,21 @@ } }, "file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", "dev": true, "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" + "flat-cache": "^2.0.1" } }, "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "to-regex-range": "^5.0.1" } }, "finalhandler": { @@ -4376,6 +4163,111 @@ "is-glob": "^4.0.0", "micromatch": "^3.0.4", "resolve-dir": "^1.0.1" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } } }, "fined": { @@ -4415,15 +4307,14 @@ } }, "flat-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", "dev": true, "requires": { - "circular-json": "^0.3.1", - "graceful-fs": "^4.1.2", - "rimraf": "~2.6.2", - "write": "^0.2.1" + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" } }, "flatted": { @@ -5144,9 +5035,9 @@ "dev": true }, "get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", + "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", "dev": true }, "get-stream": { @@ -5191,24 +5082,12 @@ } }, "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz", + "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==", "dev": true, "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } + "is-glob": "^4.0.1" } }, "glob-stream": { @@ -5227,6 +5106,27 @@ "remove-trailing-separator": "^1.0.1", "to-absolute-glob": "^2.0.0", "unique-stream": "^2.0.2" + }, + "dependencies": { + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } } }, "glob-watcher": { @@ -5274,9 +5174,9 @@ "dev": true }, "globby": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.0.tgz", - "integrity": "sha512-3LifW9M4joGZasyYPz2A1U74zbC/45fvpXUvO/9KbSa+VV0aGZarWkfdgKyR9sExNP0t0x0ss/UMJpNpcaTspw==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz", + "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==", "dev": true, "requires": { "@types/glob": "^7.1.1", @@ -5287,14 +5187,6 @@ "ignore": "^5.1.1", "merge2": "^1.2.3", "slash": "^3.0.0" - }, - "dependencies": { - "ignore": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.2.tgz", - "integrity": "sha512-vdqWBp7MyzdmHkkRWV5nY+PfGRbYbahfuvsBCh277tq+w9zyNi7h5CYJCK0kmzti9kU+O/cB7sE8HvKv6aXAKQ==", - "dev": true - } } }, "glogg": { @@ -5307,9 +5199,9 @@ } }, "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", + "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==", "dev": true }, "growl": { @@ -5408,15 +5300,6 @@ "function-bind": "^1.1.1" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, "has-binary2": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", @@ -5473,6 +5356,26 @@ "kind-of": "^4.0.0" }, "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "kind-of": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", @@ -5556,6 +5459,14 @@ "setprototypeof": "1.1.1", "statuses": ">= 1.5.0 < 2", "toidentifier": "1.0.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } } }, "http-proxy": { @@ -5576,12 +5487,12 @@ "dev": true }, "https-proxy-agent": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", - "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", + "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==", "dev": true, "requires": { - "agent-base": "^4.1.0", + "agent-base": "^4.3.0", "debug": "^3.1.0" }, "dependencies": { @@ -5618,9 +5529,9 @@ "dev": true }, "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.2.tgz", + "integrity": "sha512-vdqWBp7MyzdmHkkRWV5nY+PfGRbYbahfuvsBCh277tq+w9zyNi7h5CYJCK0kmzti9kU+O/cB7sE8HvKv6aXAKQ==", "dev": true }, "ignore-walk": { @@ -5632,6 +5543,16 @@ "minimatch": "^3.0.4" } }, + "import-fresh": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", + "integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -5655,9 +5576,9 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "ini": { @@ -5667,23 +5588,23 @@ "dev": true }, "inquirer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", - "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.0.tgz", + "integrity": "sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA==", "dev": true, "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", "cli-cursor": "^2.1.0", "cli-width": "^2.0.0", - "external-editor": "^2.1.0", + "external-editor": "^3.0.3", "figures": "^2.0.0", - "lodash": "^4.3.0", + "lodash": "^4.17.12", "mute-stream": "0.0.7", "run-async": "^2.2.0", - "rxjs": "^5.5.2", + "rxjs": "^6.4.0", "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", + "strip-ansi": "^5.1.0", "through": "^2.3.6" }, "dependencies": { @@ -5707,15 +5628,34 @@ "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" + } + } } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "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 + } } } } @@ -5898,29 +5838,15 @@ "dev": true }, "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true }, "is-path-cwd": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.1.0.tgz", - "integrity": "sha512-Sc5j3/YnM8tDeyCsVeKlm/0p95075DyLmDEIkSgQ7mXkrOX+uTCtmQFm0CYzVyJwcCCmO3k8qfJt17SxQwB5Zw==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", + "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", "dev": true }, "is-path-in-cwd": { @@ -5974,12 +5900,6 @@ "is-unc-path": "^1.0.0" } }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true - }, "is-running": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-running/-/is-running-2.1.0.tgz", @@ -6162,9 +6082,9 @@ }, "dependencies": { "semver": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.1.tgz", - "integrity": "sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz", + "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==", "dev": true } } @@ -6297,12 +6217,13 @@ } }, "jsx-ast-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.1.0.tgz", - "integrity": "sha512-yDGDG2DS4JcqhA6blsuYbtsT09xL8AoLuUR2Gb5exrw7UEM19sBcOTq+YBBhrNbl0PUC4R4LnFu+dHg2HKeVvA==", + "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==", "dev": true, "requires": { - "array-includes": "^3.0.3" + "array-includes": "^3.0.3", + "object.assign": "^4.1.0" } }, "just-debounce": { @@ -6362,15 +6283,6 @@ "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", "dev": true }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, "chokidar": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.0.2.tgz", @@ -6387,15 +6299,6 @@ "readdirp": "^3.1.1" } }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, "fsevents": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.0.7.tgz", @@ -6403,15 +6306,6 @@ "dev": true, "optional": true }, - "glob-parent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz", - "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -6421,12 +6315,6 @@ "binary-extensions": "^2.0.0" } }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -6447,15 +6335,6 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } } } }, @@ -6664,9 +6543,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, "lodash.flattendeep": { @@ -6789,6 +6668,58 @@ "stack-trace": "0.0.10" }, "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "findup-sync": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", @@ -6809,6 +6740,57 @@ "requires": { "is-extglob": "^2.1.0" } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } } } }, @@ -6880,24 +6862,13 @@ "dev": true }, "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", "dev": true, "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" + "braces": "^3.0.1", + "picomatch": "^2.0.5" } }, "miller-rabin": { @@ -6995,9 +6966,9 @@ } }, "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, "requires": { "for-in": "^1.0.2", @@ -7480,6 +7451,12 @@ "vm-browserify": "^1.0.1" }, "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", @@ -7634,38 +7611,12 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -7716,22 +7667,21 @@ "dev": true }, "yargs": { - "version": "13.2.4", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", - "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "dev": true, "requires": { "cliui": "^5.0.0", "find-up": "^3.0.0", "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.0" + "yargs-parser": "^13.1.1" } }, "yargs-parser": { @@ -7840,6 +7790,18 @@ "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.0.3", "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", @@ -7879,6 +7841,18 @@ "make-iterator": "^1.0.0" } }, + "object.values": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.0.tgz", + "integrity": "sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.12.0", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, "on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -8076,6 +8050,15 @@ "readable-stream": "^2.1.5" } }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "parse-asn1": { "version": "5.1.4", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", @@ -8210,23 +8193,10 @@ "dev": true }, "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true }, "pause-stream": { "version": "0.0.11", @@ -8287,70 +8257,28 @@ } }, "pkg-conf": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", - "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-3.1.0.tgz", + "integrity": "sha512-m0OTbR/5VPNPqO1ph6Fqbj7Hv6QU7gR/tQW40ZqrL1rjgCU85W6C1bJn0BItuJqnR98PWzw7Z8hHeChD1WrgdQ==", "dev": true, "requires": { - "find-up": "^2.0.0", - "load-json-file": "^4.0.0" + "find-up": "^3.0.0", + "load-json-file": "^5.2.0" }, "dependencies": { - "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": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", + "integrity": "sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", + "graceful-fs": "^4.1.15", "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" + "pify": "^4.0.1", + "strip-bom": "^3.0.0", + "type-fest": "^0.3.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" - } - }, - "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 - }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", @@ -8361,12 +8289,6 @@ "json-parse-better-errors": "^1.0.1" } }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -8413,12 +8335,6 @@ "extend-shallow": "^3.0.2" } }, - "pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", - "dev": true - }, "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", @@ -8450,9 +8366,9 @@ "dev": true }, "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, "progress": { @@ -8622,6 +8538,25 @@ "load-json-file": "^1.0.0", "normalize-package-data": "^2.3.2", "path-type": "^1.0.0" + }, + "dependencies": { + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } } }, "read-pkg-up": { @@ -8679,6 +8614,111 @@ "graceful-fs": "^4.1.11", "micromatch": "^3.1.10", "readable-stream": "^2.0.2" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } } }, "rechoir": { @@ -8706,9 +8746,9 @@ } }, "regenerator-transform": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.0.tgz", - "integrity": "sha512-rtOelq4Cawlbmq9xuMR5gdFmv7ku/sFoB7sRiywx7aq53bc52b4j6zvH7Te1Vt/X2YveDKnCGUbioieU7FEL3w==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.1.tgz", + "integrity": "sha512-flVuee02C3FKRISbxhXl9mGzdbWUVHubl1SMaknjxkFB1/iqpJhArQUvRxOOPEc/9tAiX0BaQ28FJH10E4isSQ==", "dev": true, "requires": { "private": "^0.1.6" @@ -8850,24 +8890,6 @@ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true }, - "require-uncached": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", - "dev": true, - "requires": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", - "dev": true - } - } - }, "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -8986,12 +9008,12 @@ } }, "rxjs": { - "version": "5.5.12", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", - "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", + "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", "dev": true, "requires": { - "symbol-observable": "1.0.1" + "tslib": "^1.9.0" } }, "safe-buffer": { @@ -9065,9 +9087,9 @@ "dev": true }, "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -9158,11 +9180,13 @@ "dev": true }, "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", "is-fullwidth-code-point": "^2.0.0" }, "dependencies": { @@ -9514,9 +9538,9 @@ } }, "spdx-license-ids": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", - "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, "split": { @@ -9559,32 +9583,32 @@ "dev": true }, "standard": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/standard/-/standard-12.0.1.tgz", - "integrity": "sha512-UqdHjh87OG2gUrNCSM4QRLF5n9h3TFPwrCNyVlkqu31Hej0L/rc8hzKqVvkb2W3x0WMq7PzZdkLfEcBhVOR6lg==", + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/standard/-/standard-13.0.2.tgz", + "integrity": "sha512-tcdJc7Oa+ZFpIcYqNaV3kG3Ikqk1Ir5dCn8vaiLWvDcXdRGvQVQGbTqW/3y4RPEHXGBXoZZRQbb6VbSGx+0aqg==", "dev": true, "requires": { - "eslint": "~5.4.0", - "eslint-config-standard": "12.0.0", - "eslint-config-standard-jsx": "6.0.2", - "eslint-plugin-import": "~2.14.0", - "eslint-plugin-node": "~7.0.1", - "eslint-plugin-promise": "~4.0.0", - "eslint-plugin-react": "~7.11.1", + "eslint": "~6.0.1", + "eslint-config-standard": "13.0.1", + "eslint-config-standard-jsx": "7.0.0", + "eslint-plugin-import": "~2.18.0", + "eslint-plugin-node": "~9.1.0", + "eslint-plugin-promise": "~4.2.1", + "eslint-plugin-react": "~7.14.2", "eslint-plugin-standard": "~4.0.0", - "standard-engine": "~9.0.0" + "standard-engine": "~11.0.1" } }, "standard-engine": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-9.0.0.tgz", - "integrity": "sha512-ZfNfCWZ2Xq67VNvKMPiVMKHnMdvxYzvZkf1AH8/cw2NLDBm5LRsxMqvEJpsjLI/dUosZ3Z1d6JlHDp5rAvvk2w==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-11.0.1.tgz", + "integrity": "sha512-WZQ5PpEDfRzPFk+H9xvKVQPQIxKnAQB2cb2Au4NyTCtdw5R0pyMBUZLbPXyFjnlhe8Ae+zfNrWU4m6H5b7cEAg==", "dev": true, "requires": { - "deglob": "^2.1.0", - "get-stdin": "^6.0.0", + "deglob": "^3.0.0", + "get-stdin": "^7.0.0", "minimist": "^1.1.0", - "pkg-conf": "^2.0.0" + "pkg-conf": "^3.1.0" } }, "static-extend": { @@ -9682,12 +9706,12 @@ }, "dependencies": { "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", + "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.11" + "lodash": "^4.17.14" } }, "debug": { @@ -9698,12 +9722,6 @@ "requires": { "ms": "^2.1.1" } - }, - "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", - "dev": true } } }, @@ -9782,30 +9800,22 @@ "integrity": "sha1-KYexzivS84sNzio0OIiEv6RADqc=", "dev": true }, - "symbol-observable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", - "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", - "dev": true - }, "table": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz", - "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.4.tgz", + "integrity": "sha512-IIfEAUx5QlODLblLrGTTLJA7Tk0iLSGBvgY8essPRVNGHAzThujww1YqHLs6h3HfTg55h++RzLHH5Xw/rfv+mg==", "dev": true, "requires": { - "ajv": "^6.0.1", - "ajv-keywords": "^3.0.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "is-fullwidth-code-point": { @@ -9815,22 +9825,23 @@ "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": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { + "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "strip-ansi": "^5.1.0" } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^4.1.0" } } } @@ -10123,13 +10134,12 @@ } }, "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "is-number": "^7.0.0" } }, "to-through": { @@ -10165,6 +10175,12 @@ "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, + "type": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz", + "integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw==", + "dev": true + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -10174,6 +10190,12 @@ "prelude-ls": "~1.1.2" } }, + "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 + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -10293,38 +10315,15 @@ "dev": true }, "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } + "set-value": "^2.0.1" } }, "uniq": { @@ -10475,12 +10474,12 @@ } }, "util": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.0.tgz", - "integrity": "sha512-pPSOFl7VLhZ7LO/SFABPraZEEurkJUWSMn3MuA/r3WQZc+Z1fqou2JqLSOZbCLl73EUIxuUVX8X4jkX2vfJeAA==", + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.1.tgz", + "integrity": "sha512-MREAtYOp+GTt9/+kwf00IYoHZyjM8VU4aVrkzUlejyqaIjd2GztVl5V9hGXKlvBKE3gENn/FMfHE5v6hElXGcQ==", "dev": true, "requires": { - "inherits": "2.0.3", + "inherits": "^2.0.3", "is-arguments": "^1.0.4", "is-generator-function": "^1.0.7", "object.entries": "^1.1.0", @@ -10647,11 +10646,108 @@ "webpack-sources": "^1.3.0" }, "dependencies": { - "acorn": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.2.0.tgz", - "integrity": "sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw==", - "dev": true + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } } } }, @@ -10759,9 +10855,9 @@ "dev": true }, "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", "dev": true, "requires": { "mkdirp": "^0.5.1" @@ -10796,9 +10892,9 @@ "dev": true }, "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true }, "y18n": { diff --git a/package.json b/package.json index e411de359..711c58d2f 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,7 @@ "benchmark": "2.1.4", "codecov": "3.5.0", "del": "5.0.0", - "expr-eval": "1.2.2", + "expr-eval": "1.2.3", "fancy-log": "1.3.3", "glob": "7.1.4", "gulp": "4.0.2", @@ -157,7 +157,7 @@ "numericjs": "1.2.6", "nyc": "14.1.1", "pad-right": "0.2.2", - "standard": "12.0.1", + "standard": "13.0.2", "sylvester": "0.0.21", "uglify-js": "3.6.0", "underscore": "1.9.1", diff --git a/src/core/function/import.js b/src/core/function/import.js index 62884e710..d7c655fd5 100644 --- a/src/core/function/import.js +++ b/src/core/function/import.js @@ -80,7 +80,7 @@ export function importFactory (typed, load, math, importedFactories) { value.forEach(item => flattenImports(flatValues, item)) } else if (typeof value === 'object') { for (const name in value) { - if (value.hasOwnProperty(name)) { + if (hasOwnProperty(value, name)) { flattenImports(flatValues, value[name], name) } } @@ -108,7 +108,7 @@ export function importFactory (typed, load, math, importedFactories) { flattenImports(flatValues, functions) for (const name in flatValues) { - if (flatValues.hasOwnProperty(name)) { + if (hasOwnProperty(flatValues, name)) { // console.log('import', name) const value = flatValues[name] @@ -247,7 +247,7 @@ export function importFactory (typed, load, math, importedFactories) { const name = factory.name const existingTransform = name in math.expression.transform const namespace = factory.path ? traverse(math, factory.path) : math - const existing = namespace.hasOwnProperty(name) ? namespace[name] : undefined + const existing = hasOwnProperty(namespace, name) ? namespace[name] : undefined const resolver = function () { let instance = load(factory) @@ -329,7 +329,7 @@ export function importFactory (typed, load, math, importedFactories) { : math const existingTransform = name in math.expression.transform - const existing = namespace.hasOwnProperty(name) ? namespace[name] : undefined + const existing = hasOwnProperty(namespace, name) ? namespace[name] : undefined const resolver = function () { // collect all dependencies, handle finding both functions and classes and other special cases @@ -353,7 +353,7 @@ export function importFactory (typed, load, math, importedFactories) { } }) - let instance = /* #__PURE__ */ factory(dependencies) + const instance = /* #__PURE__ */ factory(dependencies) if (instance && typeof instance.transform === 'function') { throw new Error('Transforms cannot be attached to factory functions. ' + @@ -442,16 +442,16 @@ export function importFactory (typed, load, math, importedFactories) { } function allowedInExpressions (name) { - return !unsafe.hasOwnProperty(name) + return !hasOwnProperty(unsafe, name) } function legacyFactoryAllowedInExpressions (factory) { - return factory.path === undefined && !unsafe.hasOwnProperty(factory.name) + 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 - !unsafe.hasOwnProperty(factory.fn) && + !hasOwnProperty(unsafe, factory.fn) && (!factory.meta || !factory.meta.isClass) } @@ -463,12 +463,12 @@ export function importFactory (typed, load, math, importedFactories) { // namespaces and functions not available in the parser for safety reasons const unsafe = { - 'expression': true, - 'type': true, - 'docs': true, - 'error': true, - 'json': true, - 'chain': true // chain method not supported. Note that there is a unit chain too. + expression: true, + type: true, + docs: true, + error: true, + json: true, + chain: true // chain method not supported. Note that there is a unit chain too. } return mathImport diff --git a/src/expression/Help.js b/src/expression/Help.js index 7bef8e052..a0978ff67 100644 --- a/src/expression/Help.js +++ b/src/expression/Help.js @@ -58,7 +58,7 @@ export const createHelpClass = /* #__PURE__ */ factory(name, dependencies, ({ pa if (doc.examples) { desc += 'Examples:\n' - let scope = {} + const scope = {} for (let i = 0; i < doc.examples.length; i++) { const expr = doc.examples[i] desc += ' ' + expr + '\n' diff --git a/src/expression/Parser.js b/src/expression/Parser.js index 6c3fd3c88..4f9b8986e 100644 --- a/src/expression/Parser.js +++ b/src/expression/Parser.js @@ -1,5 +1,5 @@ import { factory } from '../utils/factory' -import { extend } from '../utils/object' +import { extend, hasOwnProperty } from '../utils/object' import { getSafeProperty, setSafeProperty } from '../utils/customs' import { warnOnce } from '../utils/log' @@ -163,7 +163,7 @@ export const createParserClass = /* #__PURE__ */ factory(name, dependencies, ({ */ Parser.prototype.clear = function () { for (const name in this.scope) { - if (this.scope.hasOwnProperty(name)) { + if (hasOwnProperty(this.scope, name)) { delete this.scope[name] } } diff --git a/src/expression/embeddedDocs/constants/Infinity.js b/src/expression/embeddedDocs/constants/Infinity.js index 234ab9ea1..56bf4e0e2 100644 --- a/src/expression/embeddedDocs/constants/Infinity.js +++ b/src/expression/embeddedDocs/constants/Infinity.js @@ -1,13 +1,13 @@ export const InfinityDocs = { - 'name': 'Infinity', - 'category': 'Constants', - 'syntax': [ + name: 'Infinity', + category: 'Constants', + syntax: [ 'Infinity' ], - 'description': 'Infinity, a number which is larger than the maximum number that can be handled by a floating point number.', - 'examples': [ + description: 'Infinity, a number which is larger than the maximum number that can be handled by a floating point number.', + examples: [ 'Infinity', '1 / 0' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/constants/LN10.js b/src/expression/embeddedDocs/constants/LN10.js index d2f64813a..8d524c4e0 100644 --- a/src/expression/embeddedDocs/constants/LN10.js +++ b/src/expression/embeddedDocs/constants/LN10.js @@ -1,13 +1,13 @@ export const LN10Docs = { - 'name': 'LN10', - 'category': 'Constants', - 'syntax': [ + name: 'LN10', + category: 'Constants', + syntax: [ 'LN10' ], - 'description': 'Returns the natural logarithm of 10, approximately equal to 2.302', - 'examples': [ + description: 'Returns the natural logarithm of 10, approximately equal to 2.302', + examples: [ 'LN10', 'log(10)' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/constants/LN2.js b/src/expression/embeddedDocs/constants/LN2.js index 4ffe82c69..c825a803d 100644 --- a/src/expression/embeddedDocs/constants/LN2.js +++ b/src/expression/embeddedDocs/constants/LN2.js @@ -1,13 +1,13 @@ export const LN2Docs = { - 'name': 'LN2', - 'category': 'Constants', - 'syntax': [ + name: 'LN2', + category: 'Constants', + syntax: [ 'LN2' ], - 'description': 'Returns the natural logarithm of 2, approximately equal to 0.693', - 'examples': [ + description: 'Returns the natural logarithm of 2, approximately equal to 0.693', + examples: [ 'LN2', 'log(2)' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/constants/LOG10E.js b/src/expression/embeddedDocs/constants/LOG10E.js index 75bda3d90..d83576c88 100644 --- a/src/expression/embeddedDocs/constants/LOG10E.js +++ b/src/expression/embeddedDocs/constants/LOG10E.js @@ -1,13 +1,13 @@ export const LOG10EDocs = { - 'name': 'LOG10E', - 'category': 'Constants', - 'syntax': [ + name: 'LOG10E', + category: 'Constants', + syntax: [ 'LOG10E' ], - 'description': 'Returns the base-10 logarithm of E, approximately equal to 0.434', - 'examples': [ + description: 'Returns the base-10 logarithm of E, approximately equal to 0.434', + examples: [ 'LOG10E', 'log(e, 10)' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/constants/LOG2E.js b/src/expression/embeddedDocs/constants/LOG2E.js index 5b9d39bfb..e2cd602d7 100644 --- a/src/expression/embeddedDocs/constants/LOG2E.js +++ b/src/expression/embeddedDocs/constants/LOG2E.js @@ -1,13 +1,13 @@ export const LOG2EDocs = { - 'name': 'LOG2E', - 'category': 'Constants', - 'syntax': [ + name: 'LOG2E', + category: 'Constants', + syntax: [ 'LOG2E' ], - 'description': 'Returns the base-2 logarithm of E, approximately equal to 1.442', - 'examples': [ + description: 'Returns the base-2 logarithm of E, approximately equal to 1.442', + examples: [ 'LOG2E', 'log(e, 2)' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/constants/NaN.js b/src/expression/embeddedDocs/constants/NaN.js index c26f1120d..530e475c4 100644 --- a/src/expression/embeddedDocs/constants/NaN.js +++ b/src/expression/embeddedDocs/constants/NaN.js @@ -1,13 +1,13 @@ export const NaNDocs = { - 'name': 'NaN', - 'category': 'Constants', - 'syntax': [ + name: 'NaN', + category: 'Constants', + syntax: [ 'NaN' ], - 'description': 'Not a number', - 'examples': [ + description: 'Not a number', + examples: [ 'NaN', '0 / 0' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/constants/SQRT1_2.js b/src/expression/embeddedDocs/constants/SQRT1_2.js index ed7fce8bf..5e8ce3982 100644 --- a/src/expression/embeddedDocs/constants/SQRT1_2.js +++ b/src/expression/embeddedDocs/constants/SQRT1_2.js @@ -1,13 +1,13 @@ export const SQRT12Docs = { - 'name': 'SQRT1_2', - 'category': 'Constants', - 'syntax': [ + name: 'SQRT1_2', + category: 'Constants', + syntax: [ 'SQRT1_2' ], - 'description': 'Returns the square root of 1/2, approximately equal to 0.707', - 'examples': [ + description: 'Returns the square root of 1/2, approximately equal to 0.707', + examples: [ 'SQRT1_2', 'sqrt(1/2)' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/constants/SQRT2.js b/src/expression/embeddedDocs/constants/SQRT2.js index a6e57c395..135880bc0 100644 --- a/src/expression/embeddedDocs/constants/SQRT2.js +++ b/src/expression/embeddedDocs/constants/SQRT2.js @@ -1,13 +1,13 @@ export const SQRT2Docs = { - 'name': 'SQRT2', - 'category': 'Constants', - 'syntax': [ + name: 'SQRT2', + category: 'Constants', + syntax: [ 'SQRT2' ], - 'description': 'Returns the square root of 2, approximately equal to 1.414', - 'examples': [ + description: 'Returns the square root of 2, approximately equal to 1.414', + examples: [ 'SQRT2', 'sqrt(2)' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/constants/e.js b/src/expression/embeddedDocs/constants/e.js index 4b98732a0..7cc8b7c9d 100644 --- a/src/expression/embeddedDocs/constants/e.js +++ b/src/expression/embeddedDocs/constants/e.js @@ -1,15 +1,15 @@ export const eDocs = { - 'name': 'e', - 'category': 'Constants', - 'syntax': [ + name: 'e', + category: 'Constants', + syntax: [ 'e' ], - 'description': 'Euler\'s number, the base of the natural logarithm. Approximately equal to 2.71828', - 'examples': [ + description: 'Euler\'s number, the base of the natural logarithm. Approximately equal to 2.71828', + examples: [ 'e', 'e ^ 2', 'exp(2)', 'log(e)' ], - 'seealso': ['exp'] + seealso: ['exp'] } diff --git a/src/expression/embeddedDocs/constants/false.js b/src/expression/embeddedDocs/constants/false.js index f61cea021..5c9031a35 100644 --- a/src/expression/embeddedDocs/constants/false.js +++ b/src/expression/embeddedDocs/constants/false.js @@ -1,12 +1,12 @@ export const falseDocs = { - 'name': 'false', - 'category': 'Constants', - 'syntax': [ + name: 'false', + category: 'Constants', + syntax: [ 'false' ], - 'description': 'Boolean value false', - 'examples': [ + description: 'Boolean value false', + examples: [ 'false' ], - 'seealso': ['true'] + seealso: ['true'] } diff --git a/src/expression/embeddedDocs/constants/i.js b/src/expression/embeddedDocs/constants/i.js index 97020c44f..41ffd6f94 100644 --- a/src/expression/embeddedDocs/constants/i.js +++ b/src/expression/embeddedDocs/constants/i.js @@ -1,14 +1,14 @@ export const iDocs = { - 'name': 'i', - 'category': 'Constants', - 'syntax': [ + name: 'i', + category: 'Constants', + syntax: [ 'i' ], - 'description': 'Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.', - 'examples': [ + description: 'Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.', + examples: [ 'i', 'i * i', 'sqrt(-1)' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/constants/null.js b/src/expression/embeddedDocs/constants/null.js index adf3dad09..e401d541e 100644 --- a/src/expression/embeddedDocs/constants/null.js +++ b/src/expression/embeddedDocs/constants/null.js @@ -1,12 +1,12 @@ export const nullDocs = { - 'name': 'null', - 'category': 'Constants', - 'syntax': [ + name: 'null', + category: 'Constants', + syntax: [ 'null' ], - 'description': 'Value null', - 'examples': [ + description: 'Value null', + examples: [ 'null' ], - 'seealso': ['true', 'false'] + seealso: ['true', 'false'] } diff --git a/src/expression/embeddedDocs/constants/phi.js b/src/expression/embeddedDocs/constants/phi.js index e8018401d..95321c084 100644 --- a/src/expression/embeddedDocs/constants/phi.js +++ b/src/expression/embeddedDocs/constants/phi.js @@ -1,12 +1,12 @@ export const phiDocs = { - 'name': 'phi', - 'category': 'Constants', - 'syntax': [ + name: 'phi', + category: 'Constants', + syntax: [ 'phi' ], - 'description': 'Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...', - 'examples': [ + description: 'Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...', + examples: [ 'phi' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/constants/pi.js b/src/expression/embeddedDocs/constants/pi.js index 1ac43454a..0a45430cd 100644 --- a/src/expression/embeddedDocs/constants/pi.js +++ b/src/expression/embeddedDocs/constants/pi.js @@ -1,13 +1,13 @@ export const piDocs = { - 'name': 'pi', - 'category': 'Constants', - 'syntax': [ + name: 'pi', + category: 'Constants', + syntax: [ 'pi' ], - 'description': 'The number pi is a mathematical constant that is the ratio of a circle\'s circumference to its diameter, and is approximately equal to 3.14159', - 'examples': [ + description: 'The number pi is a mathematical constant that is the ratio of a circle\'s circumference to its diameter, and is approximately equal to 3.14159', + examples: [ 'pi', 'sin(pi/2)' ], - 'seealso': ['tau'] + seealso: ['tau'] } diff --git a/src/expression/embeddedDocs/constants/tau.js b/src/expression/embeddedDocs/constants/tau.js index e19736651..0705eef4a 100644 --- a/src/expression/embeddedDocs/constants/tau.js +++ b/src/expression/embeddedDocs/constants/tau.js @@ -1,13 +1,13 @@ export const tauDocs = { - 'name': 'tau', - 'category': 'Constants', - 'syntax': [ + name: 'tau', + category: 'Constants', + syntax: [ 'tau' ], - 'description': 'Tau is the ratio constant of a circle\'s circumference to radius, equal to 2 * pi, approximately 6.2832.', - 'examples': [ + description: 'Tau is the ratio constant of a circle\'s circumference to radius, equal to 2 * pi, approximately 6.2832.', + examples: [ 'tau', '2 * pi' ], - 'seealso': ['pi'] + seealso: ['pi'] } diff --git a/src/expression/embeddedDocs/constants/true.js b/src/expression/embeddedDocs/constants/true.js index add01fa87..d1d99c47f 100644 --- a/src/expression/embeddedDocs/constants/true.js +++ b/src/expression/embeddedDocs/constants/true.js @@ -1,12 +1,12 @@ export const trueDocs = { - 'name': 'true', - 'category': 'Constants', - 'syntax': [ + name: 'true', + category: 'Constants', + syntax: [ 'true' ], - 'description': 'Boolean value true', - 'examples': [ + description: 'Boolean value true', + examples: [ 'true' ], - 'seealso': ['false'] + seealso: ['false'] } diff --git a/src/expression/embeddedDocs/constants/version.js b/src/expression/embeddedDocs/constants/version.js index a0473b79c..46b2f24b7 100644 --- a/src/expression/embeddedDocs/constants/version.js +++ b/src/expression/embeddedDocs/constants/version.js @@ -1,12 +1,12 @@ export const versionDocs = { - 'name': 'version', - 'category': 'Constants', - 'syntax': [ + name: 'version', + category: 'Constants', + syntax: [ 'version' ], - 'description': 'A string with the version number of math.js', - 'examples': [ + description: 'A string with the version number of math.js', + examples: [ 'version' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/construction/bignumber.js b/src/expression/embeddedDocs/construction/bignumber.js index 6fe5a63d9..8c5e52305 100644 --- a/src/expression/embeddedDocs/construction/bignumber.js +++ b/src/expression/embeddedDocs/construction/bignumber.js @@ -1,19 +1,19 @@ export const bignumberDocs = { - 'name': 'bignumber', - 'category': 'Construction', - 'syntax': [ + name: 'bignumber', + category: 'Construction', + syntax: [ 'bignumber(x)' ], - 'description': + description: 'Create a big number from a number or string.', - 'examples': [ + examples: [ '0.1 + 0.2', 'bignumber(0.1) + bignumber(0.2)', 'bignumber("7.2")', 'bignumber("7.2e500")', 'bignumber([0.1, 0.2, 0.3])' ], - 'seealso': [ + seealso: [ 'boolean', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit' ] } diff --git a/src/expression/embeddedDocs/construction/boolean.js b/src/expression/embeddedDocs/construction/boolean.js index f8d536cff..510bd8b44 100644 --- a/src/expression/embeddedDocs/construction/boolean.js +++ b/src/expression/embeddedDocs/construction/boolean.js @@ -1,13 +1,13 @@ export const booleanDocs = { - 'name': 'boolean', - 'category': 'Construction', - 'syntax': [ + name: 'boolean', + category: 'Construction', + syntax: [ 'x', 'boolean(x)' ], - 'description': + description: 'Convert a string or number into a boolean.', - 'examples': [ + examples: [ 'boolean(0)', 'boolean(1)', 'boolean(3)', @@ -15,7 +15,7 @@ export const booleanDocs = { 'boolean("false")', 'boolean([1, 0, 1, 1])' ], - 'seealso': [ + seealso: [ 'bignumber', 'complex', 'index', 'matrix', 'number', 'string', 'unit' ] } diff --git a/src/expression/embeddedDocs/construction/complex.js b/src/expression/embeddedDocs/construction/complex.js index b46072775..afbcf2d61 100644 --- a/src/expression/embeddedDocs/construction/complex.js +++ b/src/expression/embeddedDocs/construction/complex.js @@ -1,19 +1,19 @@ export const complexDocs = { - 'name': 'complex', - 'category': 'Construction', - 'syntax': [ + name: 'complex', + category: 'Construction', + syntax: [ 'complex()', 'complex(re, im)', 'complex(string)' ], - 'description': + description: 'Create a complex number.', - 'examples': [ + examples: [ 'complex()', 'complex(2, 3)', 'complex("7 - 2i")' ], - 'seealso': [ + seealso: [ 'bignumber', 'boolean', 'index', 'matrix', 'number', 'string', 'unit' ] } diff --git a/src/expression/embeddedDocs/construction/createUnit.js b/src/expression/embeddedDocs/construction/createUnit.js index 8074a8059..4a7b70244 100644 --- a/src/expression/embeddedDocs/construction/createUnit.js +++ b/src/expression/embeddedDocs/construction/createUnit.js @@ -1,18 +1,18 @@ export const createUnitDocs = { - 'name': 'createUnit', - 'category': 'Construction', - 'syntax': [ + name: 'createUnit', + category: 'Construction', + syntax: [ 'createUnit(definitions)', 'createUnit(name, definition)' ], - 'description': + description: 'Create a user-defined unit and register it with the Unit type.', - 'examples': [ + examples: [ 'createUnit("foo")', 'createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})', 'createUnit("mph", "1 mile/hour")' ], - 'seealso': [ + seealso: [ 'unit', 'splitUnit' ] } diff --git a/src/expression/embeddedDocs/construction/fraction.js b/src/expression/embeddedDocs/construction/fraction.js index e9e4c0852..47ebc6ef3 100644 --- a/src/expression/embeddedDocs/construction/fraction.js +++ b/src/expression/embeddedDocs/construction/fraction.js @@ -1,17 +1,17 @@ export const fractionDocs = { - 'name': 'fraction', - 'category': 'Construction', - 'syntax': [ + name: 'fraction', + category: 'Construction', + syntax: [ 'fraction(num)', 'fraction(num,den)' ], - 'description': + description: 'Create a fraction from a number or from a numerator and denominator.', - 'examples': [ + examples: [ 'fraction(0.125)', 'fraction(1, 3) + fraction(2, 5)' ], - 'seealso': [ + seealso: [ 'bignumber', 'boolean', 'complex', 'index', 'matrix', 'string', 'unit' ] } diff --git a/src/expression/embeddedDocs/construction/index.js b/src/expression/embeddedDocs/construction/index.js index cb3112a38..7844cf442 100644 --- a/src/expression/embeddedDocs/construction/index.js +++ b/src/expression/embeddedDocs/construction/index.js @@ -1,7 +1,7 @@ export const indexDocs = { - 'name': 'index', - 'category': 'Construction', - 'syntax': [ + name: 'index', + category: 'Construction', + syntax: [ '[start]', '[start:end]', '[start:step:end]', @@ -9,9 +9,9 @@ export const indexDocs = { '[start1:end1, start2:end2, ...]', '[start1:step1:end1, start2:step2:end2, ...]' ], - 'description': + description: 'Create an index to get or replace a subset of a matrix', - 'examples': [ + examples: [ '[]', '[1, 2, 3]', 'A = [1, 2, 3; 4, 5, 6]', @@ -19,7 +19,7 @@ export const indexDocs = { 'A[1, 2] = 50', 'A[0:2, 0:2] = ones(2, 2)' ], - 'seealso': [ + seealso: [ 'bignumber', 'boolean', 'complex', 'matrix,', 'number', 'range', 'string', 'unit' ] } diff --git a/src/expression/embeddedDocs/construction/matrix.js b/src/expression/embeddedDocs/construction/matrix.js index 4b74e0c00..e2b709cf9 100644 --- a/src/expression/embeddedDocs/construction/matrix.js +++ b/src/expression/embeddedDocs/construction/matrix.js @@ -1,16 +1,16 @@ export const matrixDocs = { - 'name': 'matrix', - 'category': 'Construction', - 'syntax': [ + name: 'matrix', + category: 'Construction', + syntax: [ '[]', '[a1, b1, ...; a2, b2, ...]', 'matrix()', 'matrix("dense")', 'matrix([...])' ], - 'description': + description: 'Create a matrix.', - 'examples': [ + examples: [ '[]', '[1, 2, 3]', '[1, 2, 3; 4, 5, 6]', @@ -19,7 +19,7 @@ export const matrixDocs = { 'matrix([3, 4; 5, 6], "sparse")', 'matrix([3, 4; 5, 6], "sparse", "number")' ], - 'seealso': [ + seealso: [ 'bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'sparse' ] } diff --git a/src/expression/embeddedDocs/construction/number.js b/src/expression/embeddedDocs/construction/number.js index a6ca94b12..b873bc66a 100644 --- a/src/expression/embeddedDocs/construction/number.js +++ b/src/expression/embeddedDocs/construction/number.js @@ -1,14 +1,14 @@ export const numberDocs = { - 'name': 'number', - 'category': 'Construction', - 'syntax': [ + name: 'number', + category: 'Construction', + syntax: [ 'x', 'number(x)', 'number(unit, valuelessUnit)' ], - 'description': + description: 'Create a number or convert a string or boolean into a number.', - 'examples': [ + examples: [ '2', '2e3', '4.05', @@ -18,7 +18,7 @@ export const numberDocs = { 'number([true, false, true, true])', 'number(unit("52cm"), "m")' ], - 'seealso': [ + seealso: [ 'bignumber', 'boolean', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit' ] } diff --git a/src/expression/embeddedDocs/construction/sparse.js b/src/expression/embeddedDocs/construction/sparse.js index b6c97b104..6696ce94a 100644 --- a/src/expression/embeddedDocs/construction/sparse.js +++ b/src/expression/embeddedDocs/construction/sparse.js @@ -1,19 +1,19 @@ export const sparseDocs = { - 'name': 'sparse', - 'category': 'Construction', - 'syntax': [ + name: 'sparse', + category: 'Construction', + syntax: [ 'sparse()', 'sparse([a1, b1, ...; a1, b2, ...])', 'sparse([a1, b1, ...; a1, b2, ...], "number")' ], - 'description': + description: 'Create a sparse matrix.', - 'examples': [ + examples: [ 'sparse()', 'sparse([3, 4; 5, 6])', 'sparse([3, 0; 5, 0], "number")' ], - 'seealso': [ + seealso: [ 'bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'matrix' ] } diff --git a/src/expression/embeddedDocs/construction/splitUnit.js b/src/expression/embeddedDocs/construction/splitUnit.js index abb6c55fb..5bd1a29a2 100644 --- a/src/expression/embeddedDocs/construction/splitUnit.js +++ b/src/expression/embeddedDocs/construction/splitUnit.js @@ -1,15 +1,15 @@ export const splitUnitDocs = { - 'name': 'splitUnit', - 'category': 'Construction', - 'syntax': [ + name: 'splitUnit', + category: 'Construction', + syntax: [ 'splitUnit(unit: Unit, parts: Unit[])' ], - 'description': + description: 'Split a unit in an array of units whose sum is equal to the original unit.', - 'examples': [ + examples: [ 'splitUnit(1 m, ["feet", "inch"])' ], - 'seealso': [ + seealso: [ 'unit', 'createUnit' ] } diff --git a/src/expression/embeddedDocs/construction/string.js b/src/expression/embeddedDocs/construction/string.js index 6accb887c..ab79bc6dc 100644 --- a/src/expression/embeddedDocs/construction/string.js +++ b/src/expression/embeddedDocs/construction/string.js @@ -1,18 +1,18 @@ export const stringDocs = { - 'name': 'string', - 'category': 'Construction', - 'syntax': [ + name: 'string', + category: 'Construction', + syntax: [ '"text"', 'string(x)' ], - 'description': + description: 'Create a string or convert a value to a string', - 'examples': [ + examples: [ '"Hello World!"', 'string(4.2)', 'string(3 + 2i)' ], - 'seealso': [ + seealso: [ 'bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'unit' ] } diff --git a/src/expression/embeddedDocs/construction/unit.js b/src/expression/embeddedDocs/construction/unit.js index f10240708..325ce409d 100644 --- a/src/expression/embeddedDocs/construction/unit.js +++ b/src/expression/embeddedDocs/construction/unit.js @@ -1,20 +1,20 @@ export const unitDocs = { - 'name': 'unit', - 'category': 'Construction', - 'syntax': [ + name: 'unit', + category: 'Construction', + syntax: [ 'value unit', 'unit(value, unit)', 'unit(string)' ], - 'description': + description: 'Create a unit.', - 'examples': [ + examples: [ '5.5 mm', '3 inch', 'unit(7.1, "kilogram")', 'unit("23 deg")' ], - 'seealso': [ + seealso: [ 'bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'string' ] } diff --git a/src/expression/embeddedDocs/core/config.js b/src/expression/embeddedDocs/core/config.js index 858942abe..7aeddc3fa 100644 --- a/src/expression/embeddedDocs/core/config.js +++ b/src/expression/embeddedDocs/core/config.js @@ -1,16 +1,16 @@ export const configDocs = { - 'name': 'config', - 'category': 'Core', - 'syntax': [ + name: 'config', + category: 'Core', + syntax: [ 'config()', 'config(options)' ], - 'description': 'Get configuration or change configuration.', - 'examples': [ + description: 'Get configuration or change configuration.', + examples: [ 'config()', '1/3 + 1/4', 'config({number: "Fraction"})', '1/3 + 1/4' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/core/import.js b/src/expression/embeddedDocs/core/import.js index c3451b963..40f902336 100644 --- a/src/expression/embeddedDocs/core/import.js +++ b/src/expression/embeddedDocs/core/import.js @@ -1,15 +1,15 @@ export const importDocs = { - 'name': 'import', - 'category': 'Core', - 'syntax': [ + name: 'import', + category: 'Core', + syntax: [ 'import(functions)', 'import(functions, options)' ], - 'description': 'Import functions or constants from an object.', - 'examples': [ + description: 'Import functions or constants from an object.', + examples: [ 'import({myFn: f(x)=x^2, myConstant: 32 })', 'myFn(2)', 'myConstant' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/core/typed.js b/src/expression/embeddedDocs/core/typed.js index 5d39d1058..cb1fb5797 100644 --- a/src/expression/embeddedDocs/core/typed.js +++ b/src/expression/embeddedDocs/core/typed.js @@ -1,15 +1,15 @@ export const typedDocs = { - 'name': 'typed', - 'category': 'Core', - 'syntax': [ + name: 'typed', + category: 'Core', + syntax: [ 'typed(signatures)', 'typed(name, signatures)' ], - 'description': 'Create a typed function.', - 'examples': [ + description: 'Create a typed function.', + examples: [ 'double = typed({ "number, number": f(x)=x+x })', 'double(2)', 'double("hello")' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/embeddedDocs.js b/src/expression/embeddedDocs/embeddedDocs.js index 161ee516d..7c3146b85 100644 --- a/src/expression/embeddedDocs/embeddedDocs.js +++ b/src/expression/embeddedDocs/embeddedDocs.js @@ -211,7 +211,7 @@ export const embeddedDocs = { // construction functions bignumber: bignumberDocs, - 'boolean': booleanDocs, + boolean: booleanDocs, complex: complexDocs, createUnit: createUnitDocs, fraction: fractionDocs, @@ -226,22 +226,22 @@ export const embeddedDocs = { // constants e: eDocs, E: eDocs, - 'false': falseDocs, + false: falseDocs, i: iDocs, - 'Infinity': InfinityDocs, + Infinity: InfinityDocs, LN2: LN2Docs, LN10: LN10Docs, LOG2E: LOG2EDocs, LOG10E: LOG10EDocs, NaN: NaNDocs, - 'null': nullDocs, + null: nullDocs, pi: piDocs, PI: piDocs, phi: phiDocs, SQRT1_2: SQRT12Docs, SQRT2: SQRT2Docs, tau: tauDocs, - 'true': trueDocs, + true: trueDocs, version: versionDocs, // physical constants @@ -369,9 +369,9 @@ export const embeddedDocs = { stirlingS2: stirlingS2Docs, // functions - core - 'config': configDocs, - 'import': importDocs, - 'typed': typedDocs, + config: configDocs, + import: importDocs, + typed: typedDocs, // functions - complex arg: argDocs, @@ -380,8 +380,8 @@ export const embeddedDocs = { im: imDocs, // functions - expression - 'evaluate': evaluateDocs, - 'eval': evaluateDocs, // TODO: deprecated, cleanup in v7 + evaluate: evaluateDocs, + eval: evaluateDocs, // TODO: deprecated, cleanup in v7 help: helpDocs, // functions - geometry @@ -389,13 +389,13 @@ export const embeddedDocs = { intersect: intersectDocs, // functions - logical - 'and': andDocs, - 'not': notDocs, - 'or': orDocs, - 'xor': xorDocs, + and: andDocs, + not: notDocs, + or: orDocs, + xor: xorDocs, // functions - matrix - 'concat': concatDocs, + concat: concatDocs, cross: crossDocs, column: columnDocs, ctranspose: ctransposeDocs, @@ -441,7 +441,7 @@ export const embeddedDocs = { compareNatural: compareNaturalDocs, compareText: compareTextDocs, deepEqual: deepEqualDocs, - 'equal': equalDocs, + equal: equalDocs, equalText: equalTextDocs, larger: largerDocs, largerEq: largerEqDocs, @@ -475,8 +475,8 @@ export const embeddedDocs = { quantileSeq: quantileSeqDocs, std: stdDocs, sum: sumDocs, - 'variance': varianceDocs, - 'var': varianceDocs, // TODO: deprecated, cleanup in v7 + variance: varianceDocs, + var: varianceDocs, // TODO: deprecated, cleanup in v7 // functions - trigonometry acos: acosDocs, @@ -520,7 +520,7 @@ export const embeddedDocs = { isPrime: isPrimeDocs, 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 + typeOf: typeOfDocs, + typeof: typeOfDocs, // TODO: deprecated, cleanup in v7 + numeric: numericDocs } diff --git a/src/expression/embeddedDocs/function/algebra/derivative.js b/src/expression/embeddedDocs/function/algebra/derivative.js index 605c8147c..f85420b1d 100644 --- a/src/expression/embeddedDocs/function/algebra/derivative.js +++ b/src/expression/embeddedDocs/function/algebra/derivative.js @@ -1,12 +1,12 @@ export const derivativeDocs = { - 'name': 'derivative', - 'category': 'Algebra', - 'syntax': [ + name: 'derivative', + category: 'Algebra', + syntax: [ 'derivative(expr, variable)', 'derivative(expr, variable, {simplify: boolean})' ], - 'description': 'Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.', - 'examples': [ + description: 'Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.', + examples: [ 'derivative("2x^3", "x")', 'derivative("2x^3", "x", {simplify: false})', 'derivative("2x^2 + 3x + 4", "x")', @@ -16,7 +16,7 @@ export const derivativeDocs = { 'df = derivative(f, x)', 'df.evaluate({x: 3})' ], - 'seealso': [ + seealso: [ 'simplify', 'parse', 'evaluate' ] } diff --git a/src/expression/embeddedDocs/function/algebra/lsolve.js b/src/expression/embeddedDocs/function/algebra/lsolve.js index 1a1044372..0cf27bc9d 100644 --- a/src/expression/embeddedDocs/function/algebra/lsolve.js +++ b/src/expression/embeddedDocs/function/algebra/lsolve.js @@ -1,17 +1,17 @@ export const lsolveDocs = { - 'name': 'lsolve', - 'category': 'Algebra', - 'syntax': [ + name: 'lsolve', + category: 'Algebra', + syntax: [ 'x=lsolve(L, b)' ], - 'description': + description: 'Solves the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.', - 'examples': [ + examples: [ 'a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)' ], - 'seealso': [ + seealso: [ 'lup', 'lusolve', 'usolve', 'matrix', 'sparse' ] } diff --git a/src/expression/embeddedDocs/function/algebra/lup.js b/src/expression/embeddedDocs/function/algebra/lup.js index e7f89d533..bc99041d7 100644 --- a/src/expression/embeddedDocs/function/algebra/lup.js +++ b/src/expression/embeddedDocs/function/algebra/lup.js @@ -1,17 +1,17 @@ export const lupDocs = { - 'name': 'lup', - 'category': 'Algebra', - 'syntax': [ + name: 'lup', + category: 'Algebra', + syntax: [ 'lup(m)' ], - 'description': + description: 'Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U', - 'examples': [ + examples: [ 'lup([[2, 1], [1, 4]])', 'lup(matrix([[2, 1], [1, 4]]))', 'lup(sparse([[2, 1], [1, 4]]))' ], - 'seealso': [ + seealso: [ 'lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'slu', 'qr' ] } diff --git a/src/expression/embeddedDocs/function/algebra/lusolve.js b/src/expression/embeddedDocs/function/algebra/lusolve.js index f70868f97..858eed8a1 100644 --- a/src/expression/embeddedDocs/function/algebra/lusolve.js +++ b/src/expression/embeddedDocs/function/algebra/lusolve.js @@ -1,17 +1,17 @@ export const lusolveDocs = { - 'name': 'lusolve', - 'category': 'Algebra', - 'syntax': [ + name: 'lusolve', + category: 'Algebra', + syntax: [ 'x=lusolve(A, b)', 'x=lusolve(lu, b)' ], - 'description': 'Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.', - 'examples': [ + description: 'Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.', + examples: [ 'a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lusolve(a, b)' ], - 'seealso': [ + seealso: [ 'lup', 'slu', 'lsolve', 'usolve', 'matrix', 'sparse' ] } diff --git a/src/expression/embeddedDocs/function/algebra/qr.js b/src/expression/embeddedDocs/function/algebra/qr.js index 92d56836f..b92791be1 100644 --- a/src/expression/embeddedDocs/function/algebra/qr.js +++ b/src/expression/embeddedDocs/function/algebra/qr.js @@ -1,15 +1,15 @@ export const qrDocs = { - 'name': 'qr', - 'category': 'Algebra', - 'syntax': [ + name: 'qr', + category: 'Algebra', + syntax: [ 'qr(A)' ], - 'description': + description: 'Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.', - 'examples': [ + examples: [ 'qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])' ], - 'seealso': [ + seealso: [ 'lup', 'slu', 'matrix' ] } diff --git a/src/expression/embeddedDocs/function/algebra/rationalize.js b/src/expression/embeddedDocs/function/algebra/rationalize.js index 02fcfa71f..025ec1634 100644 --- a/src/expression/embeddedDocs/function/algebra/rationalize.js +++ b/src/expression/embeddedDocs/function/algebra/rationalize.js @@ -1,17 +1,17 @@ export const rationalizeDocs = { - 'name': 'rationalize', - 'category': 'Algebra', - 'syntax': [ + name: 'rationalize', + category: 'Algebra', + syntax: [ 'rationalize(expr)', 'rationalize(expr, scope)', 'rationalize(expr, scope, detailed)' ], - 'description': 'Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.', - 'examples': [ + description: 'Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.', + examples: [ 'rationalize("2x/y - y/(x+1)")', 'rationalize("2x/y - y/(x+1)", true)' ], - 'seealso': [ + seealso: [ 'simplify' ] } diff --git a/src/expression/embeddedDocs/function/algebra/simplify.js b/src/expression/embeddedDocs/function/algebra/simplify.js index 1ca9c55ce..2606b45e4 100644 --- a/src/expression/embeddedDocs/function/algebra/simplify.js +++ b/src/expression/embeddedDocs/function/algebra/simplify.js @@ -1,19 +1,19 @@ export const simplifyDocs = { - 'name': 'simplify', - 'category': 'Algebra', - 'syntax': [ + name: 'simplify', + category: 'Algebra', + syntax: [ 'simplify(expr)', 'simplify(expr, rules)' ], - 'description': 'Simplify an expression tree.', - 'examples': [ + description: 'Simplify an expression tree.', + examples: [ 'simplify("3 + 2 / 4")', 'simplify("2x + x")', 'f = parse("x * (x + 2 + x)")', 'simplified = simplify(f)', 'simplified.evaluate({x: 2})' ], - 'seealso': [ + seealso: [ 'derivative', 'parse', 'evaluate' ] } diff --git a/src/expression/embeddedDocs/function/algebra/slu.js b/src/expression/embeddedDocs/function/algebra/slu.js index 984c29e19..7cd2ab2d0 100644 --- a/src/expression/embeddedDocs/function/algebra/slu.js +++ b/src/expression/embeddedDocs/function/algebra/slu.js @@ -1,14 +1,14 @@ export const sluDocs = { - 'name': 'slu', - 'category': 'Algebra', - 'syntax': [ + name: 'slu', + category: 'Algebra', + syntax: [ 'slu(A, order, threshold)' ], - 'description': 'Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U', - 'examples': [ + description: 'Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U', + examples: [ 'slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)' ], - 'seealso': [ + seealso: [ 'lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'lup', 'qr' ] } diff --git a/src/expression/embeddedDocs/function/algebra/usolve.js b/src/expression/embeddedDocs/function/algebra/usolve.js index f58eef508..7c0903a1d 100644 --- a/src/expression/embeddedDocs/function/algebra/usolve.js +++ b/src/expression/embeddedDocs/function/algebra/usolve.js @@ -1,15 +1,15 @@ export const usolveDocs = { - 'name': 'usolve', - 'category': 'Algebra', - 'syntax': [ + name: 'usolve', + category: 'Algebra', + syntax: [ 'x=usolve(U, b)' ], - 'description': + description: 'Solves the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.', - 'examples': [ + examples: [ 'x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])' ], - 'seealso': [ + seealso: [ 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse' ] } diff --git a/src/expression/embeddedDocs/function/arithmetic/abs.js b/src/expression/embeddedDocs/function/arithmetic/abs.js index 4879f4310..dab6611ad 100644 --- a/src/expression/embeddedDocs/function/arithmetic/abs.js +++ b/src/expression/embeddedDocs/function/arithmetic/abs.js @@ -1,13 +1,13 @@ export const absDocs = { - 'name': 'abs', - 'category': 'Arithmetic', - 'syntax': [ + name: 'abs', + category: 'Arithmetic', + syntax: [ 'abs(x)' ], - 'description': 'Compute the absolute value.', - 'examples': [ + description: 'Compute the absolute value.', + examples: [ 'abs(3.5)', 'abs(-4.2)' ], - 'seealso': ['sign'] + seealso: ['sign'] } diff --git a/src/expression/embeddedDocs/function/arithmetic/add.js b/src/expression/embeddedDocs/function/arithmetic/add.js index 8439cb5b4..b551719fe 100644 --- a/src/expression/embeddedDocs/function/arithmetic/add.js +++ b/src/expression/embeddedDocs/function/arithmetic/add.js @@ -1,19 +1,19 @@ export const addDocs = { - 'name': 'add', - 'category': 'Operators', - 'syntax': [ + name: 'add', + category: 'Operators', + syntax: [ 'x + y', 'add(x, y)' ], - 'description': 'Add two values.', - 'examples': [ + description: 'Add two values.', + examples: [ 'a = 2.1 + 3.6', 'a - 3.6', '3 + 2i', '3 cm + 2 inch', '"2.3" + "4"' ], - 'seealso': [ + seealso: [ 'subtract' ] } diff --git a/src/expression/embeddedDocs/function/arithmetic/cbrt.js b/src/expression/embeddedDocs/function/arithmetic/cbrt.js index 47c1ade54..b19ec6c81 100644 --- a/src/expression/embeddedDocs/function/arithmetic/cbrt.js +++ b/src/expression/embeddedDocs/function/arithmetic/cbrt.js @@ -1,13 +1,13 @@ export const cbrtDocs = { - 'name': 'cbrt', - 'category': 'Arithmetic', - 'syntax': [ + name: 'cbrt', + category: 'Arithmetic', + syntax: [ 'cbrt(x)', 'cbrt(x, allRoots)' ], - 'description': + description: 'Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned', - 'examples': [ + examples: [ 'cbrt(64)', 'cube(4)', 'cbrt(-8)', @@ -16,7 +16,7 @@ export const cbrtDocs = { 'cbrt(8i, true)', 'cbrt(27 m^3)' ], - 'seealso': [ + seealso: [ 'square', 'sqrt', 'cube', diff --git a/src/expression/embeddedDocs/function/arithmetic/ceil.js b/src/expression/embeddedDocs/function/arithmetic/ceil.js index 8aacab10e..ae6afb8f5 100644 --- a/src/expression/embeddedDocs/function/arithmetic/ceil.js +++ b/src/expression/embeddedDocs/function/arithmetic/ceil.js @@ -1,15 +1,15 @@ export const ceilDocs = { - 'name': 'ceil', - 'category': 'Arithmetic', - 'syntax': [ + name: 'ceil', + category: 'Arithmetic', + syntax: [ 'ceil(x)' ], - 'description': + description: 'Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.', - 'examples': [ + examples: [ 'ceil(3.2)', 'ceil(3.8)', 'ceil(-4.2)' ], - 'seealso': ['floor', 'fix', 'round'] + seealso: ['floor', 'fix', 'round'] } diff --git a/src/expression/embeddedDocs/function/arithmetic/cube.js b/src/expression/embeddedDocs/function/arithmetic/cube.js index 1cf58469b..371426094 100644 --- a/src/expression/embeddedDocs/function/arithmetic/cube.js +++ b/src/expression/embeddedDocs/function/arithmetic/cube.js @@ -1,16 +1,16 @@ export const cubeDocs = { - 'name': 'cube', - 'category': 'Arithmetic', - 'syntax': [ + name: 'cube', + category: 'Arithmetic', + syntax: [ 'cube(x)' ], - 'description': 'Compute the cube of a value. The cube of x is x * x * x.', - 'examples': [ + description: 'Compute the cube of a value. The cube of x is x * x * x.', + examples: [ 'cube(2)', '2^3', '2 * 2 * 2' ], - 'seealso': [ + seealso: [ 'multiply', 'square', 'pow' diff --git a/src/expression/embeddedDocs/function/arithmetic/divide.js b/src/expression/embeddedDocs/function/arithmetic/divide.js index 83816409c..db31187da 100644 --- a/src/expression/embeddedDocs/function/arithmetic/divide.js +++ b/src/expression/embeddedDocs/function/arithmetic/divide.js @@ -1,12 +1,12 @@ export const divideDocs = { - 'name': 'divide', - 'category': 'Operators', - 'syntax': [ + name: 'divide', + category: 'Operators', + syntax: [ 'x / y', 'divide(x, y)' ], - 'description': 'Divide two values.', - 'examples': [ + description: 'Divide two values.', + examples: [ 'a = 2 / 3', 'a * 3', '4.5 / 2', @@ -14,7 +14,7 @@ export const divideDocs = { '(3 + 4) / 2', '18 km / 4.5' ], - 'seealso': [ + seealso: [ 'multiply' ] } diff --git a/src/expression/embeddedDocs/function/arithmetic/dotDivide.js b/src/expression/embeddedDocs/function/arithmetic/dotDivide.js index ec2b88fb2..7f3bada2a 100644 --- a/src/expression/embeddedDocs/function/arithmetic/dotDivide.js +++ b/src/expression/embeddedDocs/function/arithmetic/dotDivide.js @@ -1,17 +1,17 @@ export const dotDivideDocs = { - 'name': 'dotDivide', - 'category': 'Operators', - 'syntax': [ + name: 'dotDivide', + category: 'Operators', + syntax: [ 'x ./ y', 'dotDivide(x, y)' ], - 'description': 'Divide two values element wise.', - 'examples': [ + description: 'Divide two values element wise.', + examples: [ 'a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a ./ b' ], - 'seealso': [ + seealso: [ 'multiply', 'dotMultiply', 'divide' diff --git a/src/expression/embeddedDocs/function/arithmetic/dotMultiply.js b/src/expression/embeddedDocs/function/arithmetic/dotMultiply.js index 941c9648e..c9d7c4789 100644 --- a/src/expression/embeddedDocs/function/arithmetic/dotMultiply.js +++ b/src/expression/embeddedDocs/function/arithmetic/dotMultiply.js @@ -1,17 +1,17 @@ export const dotMultiplyDocs = { - 'name': 'dotMultiply', - 'category': 'Operators', - 'syntax': [ + name: 'dotMultiply', + category: 'Operators', + syntax: [ 'x .* y', 'dotMultiply(x, y)' ], - 'description': 'Multiply two values element wise.', - 'examples': [ + description: 'Multiply two values element wise.', + examples: [ 'a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a .* b' ], - 'seealso': [ + seealso: [ 'multiply', 'divide', 'dotDivide' diff --git a/src/expression/embeddedDocs/function/arithmetic/dotPow.js b/src/expression/embeddedDocs/function/arithmetic/dotPow.js index 9f70390c0..a453a3761 100644 --- a/src/expression/embeddedDocs/function/arithmetic/dotPow.js +++ b/src/expression/embeddedDocs/function/arithmetic/dotPow.js @@ -1,17 +1,17 @@ export const dotPowDocs = { - 'name': 'dotPow', - 'category': 'Operators', - 'syntax': [ + name: 'dotPow', + category: 'Operators', + syntax: [ 'x .^ y', 'dotPow(x, y)' ], - 'description': + description: 'Calculates the power of x to y element wise.', - 'examples': [ + examples: [ 'a = [1, 2, 3; 4, 5, 6]', 'a .^ 2' ], - 'seealso': [ + seealso: [ 'pow' ] } diff --git a/src/expression/embeddedDocs/function/arithmetic/exp.js b/src/expression/embeddedDocs/function/arithmetic/exp.js index 73700df58..b112344bf 100644 --- a/src/expression/embeddedDocs/function/arithmetic/exp.js +++ b/src/expression/embeddedDocs/function/arithmetic/exp.js @@ -1,18 +1,18 @@ export const expDocs = { - 'name': 'exp', - 'category': 'Arithmetic', - 'syntax': [ + name: 'exp', + category: 'Arithmetic', + syntax: [ 'exp(x)' ], - 'description': 'Calculate the exponent of a value.', - 'examples': [ + description: 'Calculate the exponent of a value.', + examples: [ 'exp(1.3)', 'e ^ 1.3', 'log(exp(1.3))', 'x = 2.4', '(exp(i*x) == cos(x) + i*sin(x)) # Euler\'s formula' ], - 'seealso': [ + seealso: [ 'expm', 'expm1', 'pow', diff --git a/src/expression/embeddedDocs/function/arithmetic/expm.js b/src/expression/embeddedDocs/function/arithmetic/expm.js index 40188b724..ca1df05d0 100644 --- a/src/expression/embeddedDocs/function/arithmetic/expm.js +++ b/src/expression/embeddedDocs/function/arithmetic/expm.js @@ -1,16 +1,16 @@ export const expmDocs = { - 'name': 'expm', - 'category': 'Arithmetic', - 'syntax': [ + name: 'expm', + category: 'Arithmetic', + syntax: [ 'exp(x)' ], - 'description': 'Compute the matrix exponential, expm(A) = e^A. ' + + description: 'Compute the matrix exponential, expm(A) = e^A. ' + 'The matrix must be square. ' + 'Not to be confused with exp(a), which performs element-wise exponentiation.', - 'examples': [ + examples: [ 'expm([[0,2],[0,0]])' ], - 'seealso': [ + seealso: [ 'exp' ] } diff --git a/src/expression/embeddedDocs/function/arithmetic/expm1.js b/src/expression/embeddedDocs/function/arithmetic/expm1.js index 84555f697..688a6bf95 100644 --- a/src/expression/embeddedDocs/function/arithmetic/expm1.js +++ b/src/expression/embeddedDocs/function/arithmetic/expm1.js @@ -1,16 +1,16 @@ export const expm1Docs = { - 'name': 'expm1', - 'category': 'Arithmetic', - 'syntax': [ + name: 'expm1', + category: 'Arithmetic', + syntax: [ 'expm1(x)' ], - 'description': 'Calculate the value of subtracting 1 from the exponential value.', - 'examples': [ + description: 'Calculate the value of subtracting 1 from the exponential value.', + examples: [ 'expm1(2)', 'pow(e, 2) - 1', 'log(expm1(2) + 1)' ], - 'seealso': [ + seealso: [ 'exp', 'pow', 'log' diff --git a/src/expression/embeddedDocs/function/arithmetic/fix.js b/src/expression/embeddedDocs/function/arithmetic/fix.js index 59b9ae55a..eb6302104 100644 --- a/src/expression/embeddedDocs/function/arithmetic/fix.js +++ b/src/expression/embeddedDocs/function/arithmetic/fix.js @@ -1,16 +1,16 @@ export const fixDocs = { - 'name': 'fix', - 'category': 'Arithmetic', - 'syntax': [ + name: 'fix', + category: 'Arithmetic', + syntax: [ 'fix(x)' ], - 'description': + description: 'Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.', - 'examples': [ + examples: [ 'fix(3.2)', 'fix(3.8)', 'fix(-4.2)', 'fix(-4.8)' ], - 'seealso': ['ceil', 'floor', 'round'] + seealso: ['ceil', 'floor', 'round'] } diff --git a/src/expression/embeddedDocs/function/arithmetic/floor.js b/src/expression/embeddedDocs/function/arithmetic/floor.js index 8138dbb08..af78e187e 100644 --- a/src/expression/embeddedDocs/function/arithmetic/floor.js +++ b/src/expression/embeddedDocs/function/arithmetic/floor.js @@ -1,15 +1,15 @@ export const floorDocs = { - 'name': 'floor', - 'category': 'Arithmetic', - 'syntax': [ + name: 'floor', + category: 'Arithmetic', + syntax: [ 'floor(x)' ], - 'description': + description: 'Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.', - 'examples': [ + examples: [ 'floor(3.2)', 'floor(3.8)', 'floor(-4.2)' ], - 'seealso': ['ceil', 'fix', 'round'] + seealso: ['ceil', 'fix', 'round'] } diff --git a/src/expression/embeddedDocs/function/arithmetic/gcd.js b/src/expression/embeddedDocs/function/arithmetic/gcd.js index 399501e73..b6f3c4f64 100644 --- a/src/expression/embeddedDocs/function/arithmetic/gcd.js +++ b/src/expression/embeddedDocs/function/arithmetic/gcd.js @@ -1,15 +1,15 @@ export const gcdDocs = { - 'name': 'gcd', - 'category': 'Arithmetic', - 'syntax': [ + name: 'gcd', + category: 'Arithmetic', + syntax: [ 'gcd(a, b)', 'gcd(a, b, c, ...)' ], - 'description': 'Compute the greatest common divisor.', - 'examples': [ + description: 'Compute the greatest common divisor.', + examples: [ 'gcd(8, 12)', 'gcd(-4, 6)', 'gcd(25, 15, -10)' ], - 'seealso': [ 'lcm', 'xgcd' ] + seealso: ['lcm', 'xgcd'] } diff --git a/src/expression/embeddedDocs/function/arithmetic/hypot.js b/src/expression/embeddedDocs/function/arithmetic/hypot.js index 17d25f973..24c037b76 100644 --- a/src/expression/embeddedDocs/function/arithmetic/hypot.js +++ b/src/expression/embeddedDocs/function/arithmetic/hypot.js @@ -1,16 +1,16 @@ export const hypotDocs = { - 'name': 'hypot', - 'category': 'Arithmetic', - 'syntax': [ + name: 'hypot', + category: 'Arithmetic', + syntax: [ 'hypot(a, b, c, ...)', 'hypot([a, b, c, ...])' ], - 'description': 'Calculate the hypotenusa of a list with values. ', - 'examples': [ + description: 'Calculate the hypotenusa of a list with values. ', + examples: [ 'hypot(3, 4)', 'sqrt(3^2 + 4^2)', 'hypot(-2)', 'hypot([3, 4, 5])' ], - 'seealso': [ 'abs', 'norm' ] + seealso: ['abs', 'norm'] } diff --git a/src/expression/embeddedDocs/function/arithmetic/lcm.js b/src/expression/embeddedDocs/function/arithmetic/lcm.js index e60fbda0d..f201ca9ff 100644 --- a/src/expression/embeddedDocs/function/arithmetic/lcm.js +++ b/src/expression/embeddedDocs/function/arithmetic/lcm.js @@ -1,14 +1,14 @@ export const lcmDocs = { - 'name': 'lcm', - 'category': 'Arithmetic', - 'syntax': [ + name: 'lcm', + category: 'Arithmetic', + syntax: [ 'lcm(x, y)' ], - 'description': 'Compute the least common multiple.', - 'examples': [ + description: 'Compute the least common multiple.', + examples: [ 'lcm(4, 6)', 'lcm(6, 21)', 'lcm(6, 21, 5)' ], - 'seealso': [ 'gcd' ] + seealso: ['gcd'] } diff --git a/src/expression/embeddedDocs/function/arithmetic/log.js b/src/expression/embeddedDocs/function/arithmetic/log.js index ee144897c..61f4fc211 100644 --- a/src/expression/embeddedDocs/function/arithmetic/log.js +++ b/src/expression/embeddedDocs/function/arithmetic/log.js @@ -1,12 +1,12 @@ export const logDocs = { - 'name': 'log', - 'category': 'Arithmetic', - 'syntax': [ + name: 'log', + category: 'Arithmetic', + syntax: [ 'log(x)', 'log(x, base)' ], - 'description': 'Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).', - 'examples': [ + description: 'Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).', + examples: [ 'log(3.5)', 'a = log(2.4)', 'exp(a)', @@ -16,7 +16,7 @@ export const logDocs = { 'b = log(1024, 2)', '2 ^ b' ], - 'seealso': [ + seealso: [ 'exp', 'log1p', 'log2', diff --git a/src/expression/embeddedDocs/function/arithmetic/log10.js b/src/expression/embeddedDocs/function/arithmetic/log10.js index 9f3099bd2..3e9b72ef2 100644 --- a/src/expression/embeddedDocs/function/arithmetic/log10.js +++ b/src/expression/embeddedDocs/function/arithmetic/log10.js @@ -1,18 +1,18 @@ export const log10Docs = { - 'name': 'log10', - 'category': 'Arithmetic', - 'syntax': [ + name: 'log10', + category: 'Arithmetic', + syntax: [ 'log10(x)' ], - 'description': 'Compute the 10-base logarithm of a value.', - 'examples': [ + description: 'Compute the 10-base logarithm of a value.', + examples: [ 'log10(0.00001)', 'log10(10000)', '10 ^ 4', 'log(10000) / log(10)', 'log(10000, 10)' ], - 'seealso': [ + seealso: [ 'exp', 'log' ] diff --git a/src/expression/embeddedDocs/function/arithmetic/log1p.js b/src/expression/embeddedDocs/function/arithmetic/log1p.js index 31d0d4de1..f1fcce0fa 100644 --- a/src/expression/embeddedDocs/function/arithmetic/log1p.js +++ b/src/expression/embeddedDocs/function/arithmetic/log1p.js @@ -1,19 +1,19 @@ export const log1pDocs = { - 'name': 'log1p', - 'category': 'Arithmetic', - 'syntax': [ + name: 'log1p', + category: 'Arithmetic', + syntax: [ 'log1p(x)', 'log1p(x, base)' ], - 'description': 'Calculate the logarithm of a `value+1`', - 'examples': [ + description: 'Calculate the logarithm of a `value+1`', + examples: [ 'log1p(2.5)', 'exp(log1p(1.4))', 'pow(10, 4)', 'log1p(9999, 10)', 'log1p(9999) / log(10)' ], - 'seealso': [ + seealso: [ 'exp', 'log', 'log2', diff --git a/src/expression/embeddedDocs/function/arithmetic/log2.js b/src/expression/embeddedDocs/function/arithmetic/log2.js index c82fce1ff..8771d30a4 100644 --- a/src/expression/embeddedDocs/function/arithmetic/log2.js +++ b/src/expression/embeddedDocs/function/arithmetic/log2.js @@ -1,17 +1,17 @@ export const log2Docs = { - 'name': 'log2', - 'category': 'Arithmetic', - 'syntax': [ + name: 'log2', + category: 'Arithmetic', + syntax: [ 'log2(x)' ], - 'description': 'Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.', - 'examples': [ + description: 'Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.', + examples: [ 'log2(0.03125)', 'log2(16)', 'log2(16) / log2(2)', 'pow(2, 4)' ], - 'seealso': [ + seealso: [ 'exp', 'log1p', 'log', diff --git a/src/expression/embeddedDocs/function/arithmetic/mod.js b/src/expression/embeddedDocs/function/arithmetic/mod.js index 7fbbb00b7..f9d49f242 100644 --- a/src/expression/embeddedDocs/function/arithmetic/mod.js +++ b/src/expression/embeddedDocs/function/arithmetic/mod.js @@ -1,14 +1,14 @@ export const modDocs = { - 'name': 'mod', - 'category': 'Operators', - 'syntax': [ + name: 'mod', + category: 'Operators', + syntax: [ 'x % y', 'x mod y', 'mod(x, y)' ], - 'description': + description: 'Calculates the modulus, the remainder of an integer division.', - 'examples': [ + examples: [ '7 % 3', '11 % 2', '10 mod 4', @@ -16,5 +16,5 @@ export const modDocs = { 'isOdd(2)', 'isOdd(3)' ], - 'seealso': ['divide'] + seealso: ['divide'] } diff --git a/src/expression/embeddedDocs/function/arithmetic/multiply.js b/src/expression/embeddedDocs/function/arithmetic/multiply.js index 600c94018..25ba7abc2 100644 --- a/src/expression/embeddedDocs/function/arithmetic/multiply.js +++ b/src/expression/embeddedDocs/function/arithmetic/multiply.js @@ -1,19 +1,19 @@ export const multiplyDocs = { - 'name': 'multiply', - 'category': 'Operators', - 'syntax': [ + name: 'multiply', + category: 'Operators', + syntax: [ 'x * y', 'multiply(x, y)' ], - 'description': 'multiply two values.', - 'examples': [ + description: 'multiply two values.', + examples: [ 'a = 2.1 * 3.4', 'a / 3.4', '2 * 3 + 4', '2 * (3 + 4)', '3 * 2.1 km' ], - 'seealso': [ + seealso: [ 'divide' ] } diff --git a/src/expression/embeddedDocs/function/arithmetic/norm.js b/src/expression/embeddedDocs/function/arithmetic/norm.js index c1092fc6e..a94f69e7a 100644 --- a/src/expression/embeddedDocs/function/arithmetic/norm.js +++ b/src/expression/embeddedDocs/function/arithmetic/norm.js @@ -1,12 +1,12 @@ export const normDocs = { - 'name': 'norm', - 'category': 'Arithmetic', - 'syntax': [ + name: 'norm', + category: 'Arithmetic', + syntax: [ 'norm(x)', 'norm(x, p)' ], - 'description': 'Calculate the norm of a number, vector or matrix.', - 'examples': [ + description: 'Calculate the norm of a number, vector or matrix.', + examples: [ 'abs(-3.5)', 'norm(-3.5)', 'norm(3 - 4i)', diff --git a/src/expression/embeddedDocs/function/arithmetic/nthRoot.js b/src/expression/embeddedDocs/function/arithmetic/nthRoot.js index 0b15c10aa..cc8a5c427 100644 --- a/src/expression/embeddedDocs/function/arithmetic/nthRoot.js +++ b/src/expression/embeddedDocs/function/arithmetic/nthRoot.js @@ -1,20 +1,20 @@ export const nthRootDocs = { - 'name': 'nthRoot', - 'category': 'Arithmetic', - 'syntax': [ + name: 'nthRoot', + category: 'Arithmetic', + syntax: [ 'nthRoot(a)', 'nthRoot(a, root)' ], - 'description': 'Calculate the nth root of a value. ' + + description: 'Calculate the nth root of a value. ' + 'The principal nth root of a positive real number A, ' + 'is the positive real solution of the equation "x^root = A".', - 'examples': [ + examples: [ '4 ^ 3', 'nthRoot(64, 3)', 'nthRoot(9, 2)', 'sqrt(9)' ], - 'seealso': [ + seealso: [ 'nthRoots', 'pow', 'sqrt' diff --git a/src/expression/embeddedDocs/function/arithmetic/nthRoots.js b/src/expression/embeddedDocs/function/arithmetic/nthRoots.js index e1f7f3181..b885350f8 100644 --- a/src/expression/embeddedDocs/function/arithmetic/nthRoots.js +++ b/src/expression/embeddedDocs/function/arithmetic/nthRoots.js @@ -1,21 +1,21 @@ export const nthRootsDocs = { - 'name': 'nthRoots', - 'category': 'Arithmetic', - 'syntax': [ + name: 'nthRoots', + category: 'Arithmetic', + syntax: [ 'nthRoots(A)', 'nthRoots(A, root)' ], - 'description': ('' + + description: ('' + '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.' ), - 'examples': [ + examples: [ 'nthRoots(1)', 'nthRoots(1, 3)' ], - 'seealso': [ + seealso: [ 'sqrt', 'pow', 'nthRoot' diff --git a/src/expression/embeddedDocs/function/arithmetic/pow.js b/src/expression/embeddedDocs/function/arithmetic/pow.js index 2bb08181d..fa63bf373 100644 --- a/src/expression/embeddedDocs/function/arithmetic/pow.js +++ b/src/expression/embeddedDocs/function/arithmetic/pow.js @@ -1,18 +1,18 @@ export const powDocs = { - 'name': 'pow', - 'category': 'Operators', - 'syntax': [ + name: 'pow', + category: 'Operators', + syntax: [ 'x ^ y', 'pow(x, y)' ], - 'description': + description: 'Calculates the power of x to y, x^y.', - 'examples': [ + examples: [ '2^3', '2*2*2', '1 + e ^ (pi * i)' ], - 'seealso': [ + seealso: [ 'multiply', 'nthRoot', 'nthRoots', diff --git a/src/expression/embeddedDocs/function/arithmetic/round.js b/src/expression/embeddedDocs/function/arithmetic/round.js index 93a04cc14..e30cb82e0 100644 --- a/src/expression/embeddedDocs/function/arithmetic/round.js +++ b/src/expression/embeddedDocs/function/arithmetic/round.js @@ -1,13 +1,13 @@ export const roundDocs = { - 'name': 'round', - 'category': 'Arithmetic', - 'syntax': [ + name: 'round', + category: 'Arithmetic', + syntax: [ 'round(x)', 'round(x, n)' ], - 'description': + description: 'round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.', - 'examples': [ + examples: [ 'round(3.2)', 'round(3.8)', 'round(-4.2)', @@ -15,5 +15,5 @@ export const roundDocs = { 'round(pi, 3)', 'round(123.45678, 2)' ], - 'seealso': ['ceil', 'floor', 'fix'] + seealso: ['ceil', 'floor', 'fix'] } diff --git a/src/expression/embeddedDocs/function/arithmetic/sign.js b/src/expression/embeddedDocs/function/arithmetic/sign.js index bc13b2aff..6b7d73073 100644 --- a/src/expression/embeddedDocs/function/arithmetic/sign.js +++ b/src/expression/embeddedDocs/function/arithmetic/sign.js @@ -1,17 +1,17 @@ export const signDocs = { - 'name': 'sign', - 'category': 'Arithmetic', - 'syntax': [ + name: 'sign', + category: 'Arithmetic', + syntax: [ 'sign(x)' ], - 'description': + description: 'Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.', - 'examples': [ + examples: [ 'sign(3.5)', 'sign(-4.2)', 'sign(0)' ], - 'seealso': [ + seealso: [ 'abs' ] } diff --git a/src/expression/embeddedDocs/function/arithmetic/sqrt.js b/src/expression/embeddedDocs/function/arithmetic/sqrt.js index 2d50e0ccc..184df7a6c 100644 --- a/src/expression/embeddedDocs/function/arithmetic/sqrt.js +++ b/src/expression/embeddedDocs/function/arithmetic/sqrt.js @@ -1,17 +1,17 @@ export const sqrtDocs = { - 'name': 'sqrt', - 'category': 'Arithmetic', - 'syntax': [ + name: 'sqrt', + category: 'Arithmetic', + syntax: [ 'sqrt(x)' ], - 'description': + description: 'Compute the square root value. If x = y * y, then y is the square root of x.', - 'examples': [ + examples: [ 'sqrt(25)', '5 * 5', 'sqrt(-1)' ], - 'seealso': [ + seealso: [ 'square', 'sqrtm', 'multiply', diff --git a/src/expression/embeddedDocs/function/arithmetic/sqrtm.js b/src/expression/embeddedDocs/function/arithmetic/sqrtm.js index 3f993d6ba..5edd10247 100644 --- a/src/expression/embeddedDocs/function/arithmetic/sqrtm.js +++ b/src/expression/embeddedDocs/function/arithmetic/sqrtm.js @@ -1,15 +1,15 @@ export const sqrtmDocs = { - 'name': 'sqrtm', - 'category': 'Arithmetic', - 'syntax': [ + name: 'sqrtm', + category: 'Arithmetic', + syntax: [ 'sqrtm(x)' ], - 'description': + description: '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`.', - 'examples': [ + examples: [ 'sqrtm([[1, 2], [3, 4]])' ], - 'seealso': [ + seealso: [ 'sqrt', 'abs', 'square', diff --git a/src/expression/embeddedDocs/function/arithmetic/square.js b/src/expression/embeddedDocs/function/arithmetic/square.js index 7a72c2fc3..ad78e2923 100644 --- a/src/expression/embeddedDocs/function/arithmetic/square.js +++ b/src/expression/embeddedDocs/function/arithmetic/square.js @@ -1,18 +1,18 @@ export const squareDocs = { - 'name': 'square', - 'category': 'Arithmetic', - 'syntax': [ + name: 'square', + category: 'Arithmetic', + syntax: [ 'square(x)' ], - 'description': + description: 'Compute the square of a value. The square of x is x * x.', - 'examples': [ + examples: [ 'square(3)', 'sqrt(9)', '3^2', '3 * 3' ], - 'seealso': [ + seealso: [ 'multiply', 'pow', 'sqrt', diff --git a/src/expression/embeddedDocs/function/arithmetic/subtract.js b/src/expression/embeddedDocs/function/arithmetic/subtract.js index a44b3ac4a..faf2fb6ab 100644 --- a/src/expression/embeddedDocs/function/arithmetic/subtract.js +++ b/src/expression/embeddedDocs/function/arithmetic/subtract.js @@ -1,19 +1,19 @@ export const subtractDocs = { - 'name': 'subtract', - 'category': 'Operators', - 'syntax': [ + name: 'subtract', + category: 'Operators', + syntax: [ 'x - y', 'subtract(x, y)' ], - 'description': 'subtract two values.', - 'examples': [ + description: 'subtract two values.', + examples: [ 'a = 5.3 - 2', 'a + 2', '2/3 - 1/6', '2 * 3 - 3', '2.1 km - 500m' ], - 'seealso': [ + seealso: [ 'add' ] } diff --git a/src/expression/embeddedDocs/function/arithmetic/unaryMinus.js b/src/expression/embeddedDocs/function/arithmetic/unaryMinus.js index f40ce881b..a1f259001 100644 --- a/src/expression/embeddedDocs/function/arithmetic/unaryMinus.js +++ b/src/expression/embeddedDocs/function/arithmetic/unaryMinus.js @@ -1,18 +1,18 @@ export const unaryMinusDocs = { - 'name': 'unaryMinus', - 'category': 'Operators', - 'syntax': [ + name: 'unaryMinus', + category: 'Operators', + syntax: [ '-x', 'unaryMinus(x)' ], - 'description': + description: 'Inverse the sign of a value. Converts booleans and strings to numbers.', - 'examples': [ + examples: [ '-4.5', '-(-5.6)', '-"22"' ], - 'seealso': [ + seealso: [ 'add', 'subtract', 'unaryPlus' ] } diff --git a/src/expression/embeddedDocs/function/arithmetic/unaryPlus.js b/src/expression/embeddedDocs/function/arithmetic/unaryPlus.js index 80ac53e50..31d6cb8af 100644 --- a/src/expression/embeddedDocs/function/arithmetic/unaryPlus.js +++ b/src/expression/embeddedDocs/function/arithmetic/unaryPlus.js @@ -1,17 +1,17 @@ export const unaryPlusDocs = { - 'name': 'unaryPlus', - 'category': 'Operators', - 'syntax': [ + name: 'unaryPlus', + category: 'Operators', + syntax: [ '+x', 'unaryPlus(x)' ], - 'description': + description: 'Converts booleans and strings to numbers.', - 'examples': [ + examples: [ '+true', '+"2"' ], - 'seealso': [ + seealso: [ 'add', 'subtract', 'unaryMinus' ] } diff --git a/src/expression/embeddedDocs/function/arithmetic/xgcd.js b/src/expression/embeddedDocs/function/arithmetic/xgcd.js index 46669846a..ae464809a 100644 --- a/src/expression/embeddedDocs/function/arithmetic/xgcd.js +++ b/src/expression/embeddedDocs/function/arithmetic/xgcd.js @@ -1,14 +1,14 @@ export const xgcdDocs = { - 'name': 'xgcd', - 'category': 'Arithmetic', - 'syntax': [ + name: 'xgcd', + category: 'Arithmetic', + syntax: [ 'xgcd(a, b)' ], - 'description': 'Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.', - 'examples': [ + description: 'Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.', + examples: [ 'xgcd(8, 12)', 'gcd(8, 12)', 'xgcd(36163, 21199)' ], - 'seealso': [ 'gcd', 'lcm' ] + seealso: ['gcd', 'lcm'] } diff --git a/src/expression/embeddedDocs/function/bitwise/bitAnd.js b/src/expression/embeddedDocs/function/bitwise/bitAnd.js index a23d9a97d..44d95c17b 100644 --- a/src/expression/embeddedDocs/function/bitwise/bitAnd.js +++ b/src/expression/embeddedDocs/function/bitwise/bitAnd.js @@ -1,17 +1,17 @@ export const bitAndDocs = { - 'name': 'bitAnd', - 'category': 'Bitwise', - 'syntax': [ + name: 'bitAnd', + category: 'Bitwise', + syntax: [ 'x & y', 'bitAnd(x, y)' ], - 'description': 'Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0', - 'examples': [ + description: 'Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0', + examples: [ '5 & 3', 'bitAnd(53, 131)', '[1, 12, 31] & 42' ], - 'seealso': [ + seealso: [ 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift' ] } diff --git a/src/expression/embeddedDocs/function/bitwise/bitNot.js b/src/expression/embeddedDocs/function/bitwise/bitNot.js index 83b79cee8..67d9899c1 100644 --- a/src/expression/embeddedDocs/function/bitwise/bitNot.js +++ b/src/expression/embeddedDocs/function/bitwise/bitNot.js @@ -1,17 +1,17 @@ export const bitNotDocs = { - 'name': 'bitNot', - 'category': 'Bitwise', - 'syntax': [ + name: 'bitNot', + category: 'Bitwise', + syntax: [ '~x', 'bitNot(x)' ], - 'description': 'Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.', - 'examples': [ + description: 'Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.', + examples: [ '~1', '~2', 'bitNot([2, -3, 4])' ], - 'seealso': [ + seealso: [ 'bitAnd', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift' ] } diff --git a/src/expression/embeddedDocs/function/bitwise/bitOr.js b/src/expression/embeddedDocs/function/bitwise/bitOr.js index f67b9fece..85cb32ffb 100644 --- a/src/expression/embeddedDocs/function/bitwise/bitOr.js +++ b/src/expression/embeddedDocs/function/bitwise/bitOr.js @@ -1,16 +1,16 @@ export const bitOrDocs = { - 'name': 'bitOr', - 'category': 'Bitwise', - 'syntax': [ + name: 'bitOr', + category: 'Bitwise', + syntax: [ 'x | y', 'bitOr(x, y)' ], - 'description': 'Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.', - 'examples': [ + description: 'Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.', + examples: [ '5 | 3', 'bitOr([1, 2, 3], 4)' ], - 'seealso': [ + seealso: [ 'bitAnd', 'bitNot', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift' ] } diff --git a/src/expression/embeddedDocs/function/bitwise/bitXor.js b/src/expression/embeddedDocs/function/bitwise/bitXor.js index 02b54a840..6ba2edcc7 100644 --- a/src/expression/embeddedDocs/function/bitwise/bitXor.js +++ b/src/expression/embeddedDocs/function/bitwise/bitXor.js @@ -1,15 +1,15 @@ export const bitXorDocs = { - 'name': 'bitXor', - 'category': 'Bitwise', - 'syntax': [ + name: 'bitXor', + category: 'Bitwise', + syntax: [ 'bitXor(x, y)' ], - 'description': 'Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.', - 'examples': [ + description: 'Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.', + examples: [ 'bitOr(1, 2)', 'bitXor([2, 3, 4], 4)' ], - 'seealso': [ + seealso: [ 'bitAnd', 'bitNot', 'bitOr', 'leftShift', 'rightArithShift', 'rightLogShift' ] } diff --git a/src/expression/embeddedDocs/function/bitwise/leftShift.js b/src/expression/embeddedDocs/function/bitwise/leftShift.js index f17ae96d5..779649f48 100644 --- a/src/expression/embeddedDocs/function/bitwise/leftShift.js +++ b/src/expression/embeddedDocs/function/bitwise/leftShift.js @@ -1,16 +1,16 @@ export const leftShiftDocs = { - 'name': 'leftShift', - 'category': 'Bitwise', - 'syntax': [ + name: 'leftShift', + category: 'Bitwise', + syntax: [ 'x << y', 'leftShift(x, y)' ], - 'description': 'Bitwise left logical shift of a value x by y number of bits.', - 'examples': [ + description: 'Bitwise left logical shift of a value x by y number of bits.', + examples: [ '4 << 1', '8 >> 1' ], - 'seealso': [ + seealso: [ 'bitAnd', 'bitNot', 'bitOr', 'bitXor', 'rightArithShift', 'rightLogShift' ] } diff --git a/src/expression/embeddedDocs/function/bitwise/rightArithShift.js b/src/expression/embeddedDocs/function/bitwise/rightArithShift.js index 86866c7a3..05b46f8e8 100644 --- a/src/expression/embeddedDocs/function/bitwise/rightArithShift.js +++ b/src/expression/embeddedDocs/function/bitwise/rightArithShift.js @@ -1,17 +1,17 @@ export const rightArithShiftDocs = { - 'name': 'rightArithShift', - 'category': 'Bitwise', - 'syntax': [ + name: 'rightArithShift', + category: 'Bitwise', + syntax: [ 'x >> y', 'rightArithShift(x, y)' ], - 'description': 'Bitwise right arithmetic shift of a value x by y number of bits.', - 'examples': [ + description: 'Bitwise right arithmetic shift of a value x by y number of bits.', + examples: [ '8 >> 1', '4 << 1', '-12 >> 2' ], - 'seealso': [ + seealso: [ 'bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightLogShift' ] } diff --git a/src/expression/embeddedDocs/function/bitwise/rightLogShift.js b/src/expression/embeddedDocs/function/bitwise/rightLogShift.js index d02138603..516975095 100644 --- a/src/expression/embeddedDocs/function/bitwise/rightLogShift.js +++ b/src/expression/embeddedDocs/function/bitwise/rightLogShift.js @@ -1,17 +1,17 @@ export const rightLogShiftDocs = { - 'name': 'rightLogShift', - 'category': 'Bitwise', - 'syntax': [ + name: 'rightLogShift', + category: 'Bitwise', + syntax: [ 'x >>> y', 'rightLogShift(x, y)' ], - 'description': 'Bitwise right logical shift of a value x by y number of bits.', - 'examples': [ + description: 'Bitwise right logical shift of a value x by y number of bits.', + examples: [ '8 >>> 1', '4 << 1', '-12 >>> 2' ], - 'seealso': [ + seealso: [ 'bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift' ] } diff --git a/src/expression/embeddedDocs/function/combinatorics/bellNumbers.js b/src/expression/embeddedDocs/function/combinatorics/bellNumbers.js index 2af3cadde..19915b751 100644 --- a/src/expression/embeddedDocs/function/combinatorics/bellNumbers.js +++ b/src/expression/embeddedDocs/function/combinatorics/bellNumbers.js @@ -1,13 +1,13 @@ export const bellNumbersDocs = { - 'name': 'bellNumbers', - 'category': 'Combinatorics', - 'syntax': [ + name: 'bellNumbers', + category: 'Combinatorics', + syntax: [ 'bellNumbers(n)' ], - 'description': 'The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.', - 'examples': [ + description: 'The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.', + examples: [ 'bellNumbers(3)', 'bellNumbers(8)' ], - 'seealso': ['stirlingS2'] + seealso: ['stirlingS2'] } diff --git a/src/expression/embeddedDocs/function/combinatorics/catalan.js b/src/expression/embeddedDocs/function/combinatorics/catalan.js index 0842b102f..37b653d39 100644 --- a/src/expression/embeddedDocs/function/combinatorics/catalan.js +++ b/src/expression/embeddedDocs/function/combinatorics/catalan.js @@ -1,13 +1,13 @@ export const catalanDocs = { - 'name': 'catalan', - 'category': 'Combinatorics', - 'syntax': [ + name: 'catalan', + category: 'Combinatorics', + syntax: [ 'catalan(n)' ], - 'description': 'The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.', - 'examples': [ + description: 'The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.', + examples: [ 'catalan(3)', 'catalan(8)' ], - 'seealso': ['bellNumbers'] + seealso: ['bellNumbers'] } diff --git a/src/expression/embeddedDocs/function/combinatorics/composition.js b/src/expression/embeddedDocs/function/combinatorics/composition.js index ffc712d40..944073662 100644 --- a/src/expression/embeddedDocs/function/combinatorics/composition.js +++ b/src/expression/embeddedDocs/function/combinatorics/composition.js @@ -1,12 +1,12 @@ export const compositionDocs = { - 'name': 'composition', - 'category': 'Combinatorics', - 'syntax': [ + name: 'composition', + category: 'Combinatorics', + syntax: [ 'composition(n, k)' ], - 'description': 'The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.', - 'examples': [ + description: 'The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.', + examples: [ 'composition(5, 3)' ], - 'seealso': ['combinations'] + seealso: ['combinations'] } diff --git a/src/expression/embeddedDocs/function/combinatorics/stirlingS2.js b/src/expression/embeddedDocs/function/combinatorics/stirlingS2.js index 82fc7e35a..3f736c39a 100644 --- a/src/expression/embeddedDocs/function/combinatorics/stirlingS2.js +++ b/src/expression/embeddedDocs/function/combinatorics/stirlingS2.js @@ -1,12 +1,12 @@ export const stirlingS2Docs = { - 'name': 'stirlingS2', - 'category': 'Combinatorics', - 'syntax': [ + name: 'stirlingS2', + category: 'Combinatorics', + syntax: [ 'stirlingS2(n, k)' ], - 'description': 'he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.', - 'examples': [ + description: 'he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.', + examples: [ 'stirlingS2(5, 3)' ], - 'seealso': ['bellNumbers'] + seealso: ['bellNumbers'] } diff --git a/src/expression/embeddedDocs/function/complex/arg.js b/src/expression/embeddedDocs/function/complex/arg.js index 4ff4f1ad4..0ecd47750 100644 --- a/src/expression/embeddedDocs/function/complex/arg.js +++ b/src/expression/embeddedDocs/function/complex/arg.js @@ -1,17 +1,17 @@ export const argDocs = { - 'name': 'arg', - 'category': 'Complex', - 'syntax': [ + name: 'arg', + category: 'Complex', + syntax: [ 'arg(x)' ], - 'description': + description: 'Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).', - 'examples': [ + examples: [ 'arg(2 + 2i)', 'atan2(3, 2)', 'arg(2 + 3i)' ], - 'seealso': [ + seealso: [ 're', 'im', 'conj', diff --git a/src/expression/embeddedDocs/function/complex/conj.js b/src/expression/embeddedDocs/function/complex/conj.js index 8168377a5..45348109d 100644 --- a/src/expression/embeddedDocs/function/complex/conj.js +++ b/src/expression/embeddedDocs/function/complex/conj.js @@ -1,17 +1,17 @@ export const conjDocs = { - 'name': 'conj', - 'category': 'Complex', - 'syntax': [ + name: 'conj', + category: 'Complex', + syntax: [ 'conj(x)' ], - 'description': + description: 'Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.', - 'examples': [ + examples: [ 'conj(2 + 3i)', 'conj(2 - 3i)', 'conj(-5.2i)' ], - 'seealso': [ + seealso: [ 're', 'im', 'abs', diff --git a/src/expression/embeddedDocs/function/complex/im.js b/src/expression/embeddedDocs/function/complex/im.js index 44e3ad211..86c075bf8 100644 --- a/src/expression/embeddedDocs/function/complex/im.js +++ b/src/expression/embeddedDocs/function/complex/im.js @@ -1,17 +1,17 @@ export const imDocs = { - 'name': 'im', - 'category': 'Complex', - 'syntax': [ + name: 'im', + category: 'Complex', + syntax: [ 'im(x)' ], - 'description': 'Get the imaginary part of a complex number.', - 'examples': [ + description: 'Get the imaginary part of a complex number.', + examples: [ 'im(2 + 3i)', 're(2 + 3i)', 'im(-5.2i)', 'im(2.4)' ], - 'seealso': [ + seealso: [ 're', 'conj', 'abs', diff --git a/src/expression/embeddedDocs/function/complex/re.js b/src/expression/embeddedDocs/function/complex/re.js index 6bc3833b3..9d950579d 100644 --- a/src/expression/embeddedDocs/function/complex/re.js +++ b/src/expression/embeddedDocs/function/complex/re.js @@ -1,17 +1,17 @@ export const reDocs = { - 'name': 're', - 'category': 'Complex', - 'syntax': [ + name: 're', + category: 'Complex', + syntax: [ 're(x)' ], - 'description': 'Get the real part of a complex number.', - 'examples': [ + description: 'Get the real part of a complex number.', + examples: [ 're(2 + 3i)', 'im(2 + 3i)', 're(-5.2i)', 're(2.4)' ], - 'seealso': [ + seealso: [ 'im', 'conj', 'abs', diff --git a/src/expression/embeddedDocs/function/expression/evaluate.js b/src/expression/embeddedDocs/function/expression/evaluate.js index fd7772e41..bdafc0534 100644 --- a/src/expression/embeddedDocs/function/expression/evaluate.js +++ b/src/expression/embeddedDocs/function/expression/evaluate.js @@ -1,14 +1,14 @@ export const evaluateDocs = { - 'name': 'evaluate', - 'category': 'Expression', - 'syntax': [ + name: 'evaluate', + category: 'Expression', + syntax: [ 'evaluate(expression)', 'evaluate([expr1, expr2, expr3, ...])' ], - 'description': 'Evaluate an expression or an array with expressions.', - 'examples': [ + description: 'Evaluate an expression or an array with expressions.', + examples: [ 'evaluate("2 + 3")', 'evaluate("sqrt(" + 4 + ")")' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/function/expression/help.js b/src/expression/embeddedDocs/function/expression/help.js index 9f1bb7a0c..49943b5ff 100644 --- a/src/expression/embeddedDocs/function/expression/help.js +++ b/src/expression/embeddedDocs/function/expression/help.js @@ -1,14 +1,14 @@ export const helpDocs = { - 'name': 'help', - 'category': 'Expression', - 'syntax': [ + name: 'help', + category: 'Expression', + syntax: [ 'help(object)', 'help(string)' ], - 'description': 'Display documentation on a function or data type.', - 'examples': [ + description: 'Display documentation on a function or data type.', + examples: [ 'help(sqrt)', 'help("complex")' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/function/geometry/distance.js b/src/expression/embeddedDocs/function/geometry/distance.js index d9891e1a4..7c9ad52f3 100644 --- a/src/expression/embeddedDocs/function/geometry/distance.js +++ b/src/expression/embeddedDocs/function/geometry/distance.js @@ -1,14 +1,14 @@ export const distanceDocs = { - 'name': 'distance', - 'category': 'Geometry', - 'syntax': [ + name: 'distance', + category: 'Geometry', + syntax: [ 'distance([x1, y1], [x2, y2])', 'distance([[x1, y1], [x2, y2])' ], - 'description': 'Calculates the Euclidean distance between two points.', - 'examples': [ + description: 'Calculates the Euclidean distance between two points.', + examples: [ 'distance([0,0], [4,4])', 'distance([[0,0], [4,4]])' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/function/geometry/intersect.js b/src/expression/embeddedDocs/function/geometry/intersect.js index a0e285b2d..3d82da422 100644 --- a/src/expression/embeddedDocs/function/geometry/intersect.js +++ b/src/expression/embeddedDocs/function/geometry/intersect.js @@ -1,14 +1,14 @@ export const intersectDocs = { - 'name': 'intersect', - 'category': 'Geometry', - 'syntax': [ + name: 'intersect', + category: 'Geometry', + syntax: [ 'intersect(expr1, expr2, expr3, expr4)', 'intersect(expr1, expr2, expr3)' ], - 'description': 'Computes the intersection point of lines and/or planes.', - 'examples': [ + description: 'Computes the intersection point of lines and/or planes.', + examples: [ 'intersect([0, 0], [10, 10], [10, 0], [0, 10])', 'intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/function/logical/and.js b/src/expression/embeddedDocs/function/logical/and.js index 56d6c6ab2..e9f812ace 100644 --- a/src/expression/embeddedDocs/function/logical/and.js +++ b/src/expression/embeddedDocs/function/logical/and.js @@ -1,17 +1,17 @@ export const andDocs = { - 'name': 'and', - 'category': 'Logical', - 'syntax': [ + name: 'and', + category: 'Logical', + syntax: [ 'x and y', 'and(x, y)' ], - 'description': 'Logical and. Test whether two values are both defined with a nonzero/nonempty value.', - 'examples': [ + description: 'Logical and. Test whether two values are both defined with a nonzero/nonempty value.', + examples: [ 'true and false', 'true and true', '2 and 4' ], - 'seealso': [ + seealso: [ 'not', 'or', 'xor' ] } diff --git a/src/expression/embeddedDocs/function/logical/not.js b/src/expression/embeddedDocs/function/logical/not.js index 20bd36849..38d509f6c 100644 --- a/src/expression/embeddedDocs/function/logical/not.js +++ b/src/expression/embeddedDocs/function/logical/not.js @@ -1,18 +1,18 @@ export const notDocs = { - 'name': 'not', - 'category': 'Logical', - 'syntax': [ + name: 'not', + category: 'Logical', + syntax: [ 'not x', 'not(x)' ], - 'description': 'Logical not. Flips the boolean value of given argument.', - 'examples': [ + description: 'Logical not. Flips the boolean value of given argument.', + examples: [ 'not true', 'not false', 'not 2', 'not 0' ], - 'seealso': [ + seealso: [ 'and', 'or', 'xor' ] } diff --git a/src/expression/embeddedDocs/function/logical/or.js b/src/expression/embeddedDocs/function/logical/or.js index 2aded9d3b..5e7d1e944 100644 --- a/src/expression/embeddedDocs/function/logical/or.js +++ b/src/expression/embeddedDocs/function/logical/or.js @@ -1,17 +1,17 @@ export const orDocs = { - 'name': 'or', - 'category': 'Logical', - 'syntax': [ + name: 'or', + category: 'Logical', + syntax: [ 'x or y', 'or(x, y)' ], - 'description': 'Logical or. Test if at least one value is defined with a nonzero/nonempty value.', - 'examples': [ + description: 'Logical or. Test if at least one value is defined with a nonzero/nonempty value.', + examples: [ 'true or false', 'false or false', '0 or 4' ], - 'seealso': [ + seealso: [ 'not', 'and', 'xor' ] } diff --git a/src/expression/embeddedDocs/function/logical/xor.js b/src/expression/embeddedDocs/function/logical/xor.js index 3e7704cd1..65dd142b8 100644 --- a/src/expression/embeddedDocs/function/logical/xor.js +++ b/src/expression/embeddedDocs/function/logical/xor.js @@ -1,18 +1,18 @@ export const xorDocs = { - 'name': 'xor', - 'category': 'Logical', - 'syntax': [ + name: 'xor', + category: 'Logical', + syntax: [ 'x xor y', 'xor(x, y)' ], - 'description': 'Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.', - 'examples': [ + description: 'Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.', + examples: [ 'true xor false', 'false xor false', 'true xor true', '0 xor 4' ], - 'seealso': [ + seealso: [ 'not', 'and', 'or' ] } diff --git a/src/expression/embeddedDocs/function/matrix/column.js b/src/expression/embeddedDocs/function/matrix/column.js index a21a1787b..5bc20d908 100644 --- a/src/expression/embeddedDocs/function/matrix/column.js +++ b/src/expression/embeddedDocs/function/matrix/column.js @@ -1,14 +1,14 @@ export const columnDocs = { - 'name': 'column', - 'category': 'Matrix', - 'syntax': [ + name: 'column', + category: 'Matrix', + syntax: [ 'column(x, index)' ], - 'description': 'Return a column from a matrix or array.', - 'examples': [ + description: 'Return a column from a matrix or array.', + examples: [ 'A = [[1, 2], [3, 4]]', 'column(A, 1)', 'column(A, 2)' ], - 'seealso': ['row'] + seealso: ['row'] } diff --git a/src/expression/embeddedDocs/function/matrix/concat.js b/src/expression/embeddedDocs/function/matrix/concat.js index ba2ff6b5c..522a34ac9 100644 --- a/src/expression/embeddedDocs/function/matrix/concat.js +++ b/src/expression/embeddedDocs/function/matrix/concat.js @@ -1,19 +1,19 @@ export const concatDocs = { - 'name': 'concat', - 'category': 'Matrix', - 'syntax': [ + name: 'concat', + category: 'Matrix', + syntax: [ 'concat(A, B, C, ...)', 'concat(A, B, C, ..., dim)' ], - 'description': 'Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.', - 'examples': [ + description: 'Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.', + examples: [ 'A = [1, 2; 5, 6]', 'B = [3, 4; 7, 8]', 'concat(A, B)', 'concat(A, B, 1)', 'concat(A, B, 2)' ], - 'seealso': [ + seealso: [ 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros' ] } diff --git a/src/expression/embeddedDocs/function/matrix/cross.js b/src/expression/embeddedDocs/function/matrix/cross.js index def5057c3..a20a6b2c4 100644 --- a/src/expression/embeddedDocs/function/matrix/cross.js +++ b/src/expression/embeddedDocs/function/matrix/cross.js @@ -1,16 +1,16 @@ export const crossDocs = { - 'name': 'cross', - 'category': 'Matrix', - 'syntax': [ + name: 'cross', + category: 'Matrix', + syntax: [ 'cross(A, B)' ], - 'description': 'Calculate the cross product for two vectors in three dimensional space.', - 'examples': [ + description: 'Calculate the cross product for two vectors in three dimensional space.', + examples: [ 'cross([1, 1, 0], [0, 1, 1])', 'cross([3, -3, 1], [4, 9, 2])', 'cross([2, 3, 4], [5, 6, 7])' ], - 'seealso': [ + seealso: [ 'multiply', 'dot' ] diff --git a/src/expression/embeddedDocs/function/matrix/ctranspose.js b/src/expression/embeddedDocs/function/matrix/ctranspose.js index 14cd33e52..a833b3b64 100644 --- a/src/expression/embeddedDocs/function/matrix/ctranspose.js +++ b/src/expression/embeddedDocs/function/matrix/ctranspose.js @@ -1,17 +1,17 @@ export const ctransposeDocs = { - 'name': 'ctranspose', - 'category': 'Matrix', - 'syntax': [ + name: 'ctranspose', + category: 'Matrix', + syntax: [ 'x\'', 'ctranspose(x)' ], - 'description': 'Complex Conjugate and Transpose a matrix', - 'examples': [ + description: 'Complex Conjugate and Transpose a matrix', + examples: [ 'a = [1, 2, 3; 4, 5, 6]', 'a\'', 'ctranspose(a)' ], - 'seealso': [ + seealso: [ 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros' ] } diff --git a/src/expression/embeddedDocs/function/matrix/det.js b/src/expression/embeddedDocs/function/matrix/det.js index 3f413ce3b..255ba1f73 100644 --- a/src/expression/embeddedDocs/function/matrix/det.js +++ b/src/expression/embeddedDocs/function/matrix/det.js @@ -1,15 +1,15 @@ export const detDocs = { - 'name': 'det', - 'category': 'Matrix', - 'syntax': [ + name: 'det', + category: 'Matrix', + syntax: [ 'det(x)' ], - 'description': 'Calculate the determinant of a matrix', - 'examples': [ + description: 'Calculate the determinant of a matrix', + examples: [ 'det([1, 2; 3, 4])', 'det([-2, 2, 3; -1, 1, 3; 2, 0, -1])' ], - 'seealso': [ + seealso: [ 'concat', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros' ] } diff --git a/src/expression/embeddedDocs/function/matrix/diag.js b/src/expression/embeddedDocs/function/matrix/diag.js index 3e066f640..cf15f9684 100644 --- a/src/expression/embeddedDocs/function/matrix/diag.js +++ b/src/expression/embeddedDocs/function/matrix/diag.js @@ -1,18 +1,18 @@ export const diagDocs = { - 'name': 'diag', - 'category': 'Matrix', - 'syntax': [ + name: 'diag', + category: 'Matrix', + syntax: [ 'diag(x)', 'diag(x, k)' ], - 'description': 'Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.', - 'examples': [ + description: 'Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.', + examples: [ 'diag(1:3)', 'diag(1:3, 1)', 'a = [1, 2, 3; 4, 5, 6; 7, 8, 9]', 'diag(a)' ], - 'seealso': [ + seealso: [ 'concat', 'det', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros' ] } diff --git a/src/expression/embeddedDocs/function/matrix/dot.js b/src/expression/embeddedDocs/function/matrix/dot.js index 708e96107..1eeb7bca1 100644 --- a/src/expression/embeddedDocs/function/matrix/dot.js +++ b/src/expression/embeddedDocs/function/matrix/dot.js @@ -1,18 +1,18 @@ export const dotDocs = { - 'name': 'dot', - 'category': 'Matrix', - 'syntax': [ + name: 'dot', + category: 'Matrix', + syntax: [ 'dot(A, B)', 'A * B' ], - 'description': 'Calculate the dot product of two vectors. ' + + description: '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 dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn', - 'examples': [ + examples: [ 'dot([2, 4, 1], [2, 2, 3])', '[2, 4, 1] * [2, 2, 3]' ], - 'seealso': [ + seealso: [ 'multiply', 'cross' ] diff --git a/src/expression/embeddedDocs/function/matrix/filter.js b/src/expression/embeddedDocs/function/matrix/filter.js index 3e6e7a77f..215d03722 100644 --- a/src/expression/embeddedDocs/function/matrix/filter.js +++ b/src/expression/embeddedDocs/function/matrix/filter.js @@ -1,14 +1,14 @@ export const filterDocs = { - 'name': 'filter', - 'category': 'Matrix', - 'syntax': [ + name: 'filter', + category: 'Matrix', + syntax: [ 'filter(x, test)' ], - 'description': 'Filter items in a matrix.', - 'examples': [ + description: 'Filter items in a matrix.', + examples: [ 'isPositive(x) = x > 0', 'filter([6, -2, -1, 4, 3], isPositive)', 'filter([6, -2, 0, 1, 0], x != 0)' ], - 'seealso': ['sort', 'map', 'forEach'] + seealso: ['sort', 'map', 'forEach'] } diff --git a/src/expression/embeddedDocs/function/matrix/flatten.js b/src/expression/embeddedDocs/function/matrix/flatten.js index c82880ca5..9eed64e9b 100644 --- a/src/expression/embeddedDocs/function/matrix/flatten.js +++ b/src/expression/embeddedDocs/function/matrix/flatten.js @@ -1,17 +1,17 @@ export const flattenDocs = { - 'name': 'flatten', - 'category': 'Matrix', - 'syntax': [ + name: 'flatten', + category: 'Matrix', + syntax: [ 'flatten(x)' ], - 'description': 'Flatten a multi dimensional matrix into a single dimensional matrix.', - 'examples': [ + description: 'Flatten a multi dimensional matrix into a single dimensional matrix.', + examples: [ 'a = [1, 2, 3; 4, 5, 6]', 'size(a)', 'b = flatten(a)', 'size(b)' ], - 'seealso': [ + seealso: [ 'concat', 'resize', 'size', 'squeeze' ] } diff --git a/src/expression/embeddedDocs/function/matrix/forEach.js b/src/expression/embeddedDocs/function/matrix/forEach.js index 60f7e9a93..f43f732cc 100644 --- a/src/expression/embeddedDocs/function/matrix/forEach.js +++ b/src/expression/embeddedDocs/function/matrix/forEach.js @@ -1,12 +1,12 @@ export const forEachDocs = { - 'name': 'forEach', - 'category': 'Matrix', - 'syntax': [ + name: 'forEach', + category: 'Matrix', + syntax: [ 'forEach(x, callback)' ], - 'description': 'Iterates over all elements of a matrix/array, and executes the given callback function.', - 'examples': [ + description: 'Iterates over all elements of a matrix/array, and executes the given callback function.', + examples: [ 'forEach([1, 2, 3], function(val) { console.log(val) })' ], - 'seealso': ['map', 'sort', 'filter'] + seealso: ['map', 'sort', 'filter'] } diff --git a/src/expression/embeddedDocs/function/matrix/getMatrixDataType.js b/src/expression/embeddedDocs/function/matrix/getMatrixDataType.js index e72342dfe..12db97dba 100644 --- a/src/expression/embeddedDocs/function/matrix/getMatrixDataType.js +++ b/src/expression/embeddedDocs/function/matrix/getMatrixDataType.js @@ -1,18 +1,18 @@ export const getMatrixDataTypeDocs = { - 'name': 'getMatrixDataType', - 'category': 'Matrix', - 'syntax': [ + name: 'getMatrixDataType', + category: 'Matrix', + syntax: [ 'getMatrixDataType(x)' ], - 'description': 'Find the data type of all elements in a matrix or array, ' + + description: 'Find the data type of all elements in a matrix or array, ' + 'for example "number" if all items are a number ' + 'and "Complex" if all values are complex numbers. ' + 'If a matrix contains more than one data type, it will return "mixed".', - 'examples': [ + examples: [ 'getMatrixDataType([1, 2, 3])', 'getMatrixDataType([[5 cm], [2 inch]])', 'getMatrixDataType([1, "text"])', 'getMatrixDataType([1, bignumber(4)])' ], - 'seealso': ['matrix', 'sparse', 'typeOf'] + seealso: ['matrix', 'sparse', 'typeOf'] } diff --git a/src/expression/embeddedDocs/function/matrix/identity.js b/src/expression/embeddedDocs/function/matrix/identity.js index 16da25753..813114e1d 100644 --- a/src/expression/embeddedDocs/function/matrix/identity.js +++ b/src/expression/embeddedDocs/function/matrix/identity.js @@ -1,19 +1,19 @@ export const identityDocs = { - 'name': 'identity', - 'category': 'Matrix', - 'syntax': [ + name: 'identity', + category: 'Matrix', + syntax: [ 'identity(n)', 'identity(m, n)', 'identity([m, n])' ], - 'description': 'Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.', - 'examples': [ + description: 'Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.', + examples: [ 'identity(3)', 'identity(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'identity(size(a))' ], - 'seealso': [ + seealso: [ 'concat', 'det', 'diag', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros' ] } diff --git a/src/expression/embeddedDocs/function/matrix/inv.js b/src/expression/embeddedDocs/function/matrix/inv.js index a2117ef8a..dd9e3129b 100644 --- a/src/expression/embeddedDocs/function/matrix/inv.js +++ b/src/expression/embeddedDocs/function/matrix/inv.js @@ -1,16 +1,16 @@ export const invDocs = { - 'name': 'inv', - 'category': 'Matrix', - 'syntax': [ + name: 'inv', + category: 'Matrix', + syntax: [ 'inv(x)' ], - 'description': 'Calculate the inverse of a matrix', - 'examples': [ + description: 'Calculate the inverse of a matrix', + examples: [ 'inv([1, 2; 3, 4])', 'inv(4)', '1 / 4' ], - 'seealso': [ + seealso: [ 'concat', 'det', 'diag', 'identity', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros' ] } diff --git a/src/expression/embeddedDocs/function/matrix/kron.js b/src/expression/embeddedDocs/function/matrix/kron.js index 04858e8a2..187bfc247 100644 --- a/src/expression/embeddedDocs/function/matrix/kron.js +++ b/src/expression/embeddedDocs/function/matrix/kron.js @@ -1,15 +1,15 @@ export const kronDocs = { - 'name': 'kron', - 'category': 'Matrix', - 'syntax': [ + name: 'kron', + category: 'Matrix', + syntax: [ 'kron(x, y)' ], - 'description': 'Calculates the kronecker product of 2 matrices or vectors.', - 'examples': [ + description: 'Calculates the kronecker product of 2 matrices or vectors.', + examples: [ 'kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])', 'kron([1,1], [2,3,4])' ], - 'seealso': [ + seealso: [ 'multiply', 'dot', 'cross' ] } diff --git a/src/expression/embeddedDocs/function/matrix/map.js b/src/expression/embeddedDocs/function/matrix/map.js index 698b2a784..4032dd591 100644 --- a/src/expression/embeddedDocs/function/matrix/map.js +++ b/src/expression/embeddedDocs/function/matrix/map.js @@ -1,12 +1,12 @@ export const mapDocs = { - 'name': 'map', - 'category': 'Matrix', - 'syntax': [ + name: 'map', + category: 'Matrix', + syntax: [ 'map(x, callback)' ], - 'description': 'Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.', - 'examples': [ + description: 'Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.', + examples: [ 'map([1, 2, 3], square)' ], - 'seealso': ['filter', 'forEach'] + seealso: ['filter', 'forEach'] } diff --git a/src/expression/embeddedDocs/function/matrix/ones.js b/src/expression/embeddedDocs/function/matrix/ones.js index cb04fde19..4c1d9b156 100644 --- a/src/expression/embeddedDocs/function/matrix/ones.js +++ b/src/expression/embeddedDocs/function/matrix/ones.js @@ -1,7 +1,7 @@ export const onesDocs = { - 'name': 'ones', - 'category': 'Matrix', - 'syntax': [ + name: 'ones', + category: 'Matrix', + syntax: [ 'ones(m)', 'ones(m, n)', 'ones(m, n, p, ...)', @@ -9,15 +9,15 @@ export const onesDocs = { 'ones([m, n])', 'ones([m, n, p, ...])' ], - 'description': 'Create a matrix containing ones.', - 'examples': [ + description: 'Create a matrix containing ones.', + examples: [ 'ones(3)', 'ones(3, 5)', 'ones([2,3]) * 4.5', 'a = [1, 2, 3; 4, 5, 6]', 'ones(size(a))' ], - 'seealso': [ + seealso: [ 'concat', 'det', 'diag', 'identity', 'inv', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros' ] } diff --git a/src/expression/embeddedDocs/function/matrix/partitionSelect.js b/src/expression/embeddedDocs/function/matrix/partitionSelect.js index 43cbc7c9f..cff3f3fd9 100644 --- a/src/expression/embeddedDocs/function/matrix/partitionSelect.js +++ b/src/expression/embeddedDocs/function/matrix/partitionSelect.js @@ -1,14 +1,14 @@ export const partitionSelectDocs = { - 'name': 'partitionSelect', - 'category': 'Matrix', - 'syntax': [ + name: 'partitionSelect', + category: 'Matrix', + syntax: [ 'partitionSelect(x, k)', 'partitionSelect(x, k, compare)' ], - 'description': 'Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.', - 'examples': [ + description: 'Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.', + examples: [ 'partitionSelect([5, 10, 1], 2)', 'partitionSelect(["C", "B", "A", "D"], 1)' ], - 'seealso': ['sort'] + seealso: ['sort'] } diff --git a/src/expression/embeddedDocs/function/matrix/range.js b/src/expression/embeddedDocs/function/matrix/range.js index d5aeef8e9..86471a76f 100644 --- a/src/expression/embeddedDocs/function/matrix/range.js +++ b/src/expression/embeddedDocs/function/matrix/range.js @@ -1,16 +1,16 @@ export const rangeDocs = { - 'name': 'range', - 'category': 'Type', - 'syntax': [ + name: 'range', + category: 'Type', + syntax: [ 'start:end', 'start:step:end', 'range(start, end)', 'range(start, end, step)', 'range(string)' ], - 'description': + description: 'Create a range. Lower bound of the range is included, upper bound is excluded.', - 'examples': [ + examples: [ '1:5', '3:-1:-3', 'range(3, 7)', @@ -19,7 +19,7 @@ export const rangeDocs = { 'a = [1, 2, 3, 4; 5, 6, 7, 8]', 'a[1:2, 1:2]' ], - 'seealso': [ + seealso: [ 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros' ] } diff --git a/src/expression/embeddedDocs/function/matrix/reshape.js b/src/expression/embeddedDocs/function/matrix/reshape.js index 86cfa178b..00d9ba1d9 100644 --- a/src/expression/embeddedDocs/function/matrix/reshape.js +++ b/src/expression/embeddedDocs/function/matrix/reshape.js @@ -1,16 +1,16 @@ export const reshapeDocs = { - 'name': 'reshape', - 'category': 'Matrix', - 'syntax': [ + name: 'reshape', + category: 'Matrix', + syntax: [ 'reshape(x, sizes)' ], - 'description': 'Reshape a multi dimensional array to fit the specified dimensions.', - 'examples': [ + description: 'Reshape a multi dimensional array to fit the specified dimensions.', + examples: [ 'reshape([1, 2, 3, 4, 5, 6], [2, 3])', 'reshape([[1, 2], [3, 4]], [1, 4])', 'reshape([[1, 2], [3, 4]], [4])' ], - 'seealso': [ + seealso: [ 'size', 'squeeze', 'resize' ] } diff --git a/src/expression/embeddedDocs/function/matrix/resize.js b/src/expression/embeddedDocs/function/matrix/resize.js index c3e92073d..9b30d45e8 100644 --- a/src/expression/embeddedDocs/function/matrix/resize.js +++ b/src/expression/embeddedDocs/function/matrix/resize.js @@ -1,19 +1,19 @@ export const resizeDocs = { - 'name': 'resize', - 'category': 'Matrix', - 'syntax': [ + name: 'resize', + category: 'Matrix', + syntax: [ 'resize(x, size)', 'resize(x, size, defaultValue)' ], - 'description': 'Resize a matrix.', - 'examples': [ + description: 'Resize a matrix.', + examples: [ 'resize([1,2,3,4,5], [3])', 'resize([1,2,3], [5])', 'resize([1,2,3], [5], -1)', 'resize(2, [2, 3])', 'resize("hello", [8], "!")' ], - 'seealso': [ + seealso: [ 'size', 'subset', 'squeeze', 'reshape' ] } diff --git a/src/expression/embeddedDocs/function/matrix/row.js b/src/expression/embeddedDocs/function/matrix/row.js index 6ff19468e..eb54039b4 100644 --- a/src/expression/embeddedDocs/function/matrix/row.js +++ b/src/expression/embeddedDocs/function/matrix/row.js @@ -1,14 +1,14 @@ export const rowDocs = { - 'name': 'row', - 'category': 'Matrix', - 'syntax': [ + name: 'row', + category: 'Matrix', + syntax: [ 'row(x, index)' ], - 'description': 'Return a row from a matrix or array.', - 'examples': [ + description: 'Return a row from a matrix or array.', + examples: [ 'A = [[1, 2], [3, 4]]', 'row(A, 1)', 'row(A, 2)' ], - 'seealso': ['column'] + seealso: ['column'] } diff --git a/src/expression/embeddedDocs/function/matrix/size.js b/src/expression/embeddedDocs/function/matrix/size.js index fb24e599b..18ece550e 100644 --- a/src/expression/embeddedDocs/function/matrix/size.js +++ b/src/expression/embeddedDocs/function/matrix/size.js @@ -1,18 +1,18 @@ export const sizeDocs = { - 'name': 'size', - 'category': 'Matrix', - 'syntax': [ + name: 'size', + category: 'Matrix', + syntax: [ 'size(x)' ], - 'description': 'Calculate the size of a matrix.', - 'examples': [ + description: 'Calculate the size of a matrix.', + examples: [ 'size(2.3)', 'size("hello world")', 'a = [1, 2; 3, 4; 5, 6]', 'size(a)', 'size(1:6)' ], - 'seealso': [ + seealso: [ 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'squeeze', 'subset', 'trace', 'transpose', 'zeros' ] } diff --git a/src/expression/embeddedDocs/function/matrix/sort.js b/src/expression/embeddedDocs/function/matrix/sort.js index f516205ed..84b5f4fb8 100644 --- a/src/expression/embeddedDocs/function/matrix/sort.js +++ b/src/expression/embeddedDocs/function/matrix/sort.js @@ -1,17 +1,17 @@ export const sortDocs = { - 'name': 'sort', - 'category': 'Matrix', - 'syntax': [ + name: 'sort', + category: 'Matrix', + syntax: [ 'sort(x)', 'sort(x, compare)' ], - 'description': 'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.', - 'examples': [ + description: 'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.', + examples: [ 'sort([5, 10, 1])', 'sort(["C", "B", "A", "D"])', 'sortByLength(a, b) = size(a)[1] - size(b)[1]', 'sort(["Langdon", "Tom", "Sara"], sortByLength)', 'sort(["10", "1", "2"], "natural")' ], - 'seealso': ['map', 'filter', 'forEach'] + seealso: ['map', 'filter', 'forEach'] } diff --git a/src/expression/embeddedDocs/function/matrix/squeeze.js b/src/expression/embeddedDocs/function/matrix/squeeze.js index 4b87c647e..abc903e38 100644 --- a/src/expression/embeddedDocs/function/matrix/squeeze.js +++ b/src/expression/embeddedDocs/function/matrix/squeeze.js @@ -1,17 +1,17 @@ export const squeezeDocs = { - 'name': 'squeeze', - 'category': 'Matrix', - 'syntax': [ + name: 'squeeze', + category: 'Matrix', + syntax: [ 'squeeze(x)' ], - 'description': 'Remove inner and outer singleton dimensions from a matrix.', - 'examples': [ + description: 'Remove inner and outer singleton dimensions from a matrix.', + examples: [ 'a = zeros(3,2,1)', 'size(squeeze(a))', 'b = zeros(1,1,3)', 'size(squeeze(b))' ], - 'seealso': [ + seealso: [ 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'subset', 'trace', 'transpose', 'zeros' ] } diff --git a/src/expression/embeddedDocs/function/matrix/subset.js b/src/expression/embeddedDocs/function/matrix/subset.js index 0f3154573..869ba9019 100644 --- a/src/expression/embeddedDocs/function/matrix/subset.js +++ b/src/expression/embeddedDocs/function/matrix/subset.js @@ -1,16 +1,16 @@ export const subsetDocs = { - 'name': 'subset', - 'category': 'Matrix', - 'syntax': [ + name: 'subset', + category: 'Matrix', + syntax: [ 'value(index)', 'value(index) = replacement', 'subset(value, [index])', 'subset(value, [index], replacement)' ], - 'description': 'Get or set a subset of a matrix or string. ' + + description: 'Get or set a subset of a matrix or string. ' + 'Indexes are one-based. ' + 'Both the ranges lower-bound and upper-bound are included.', - 'examples': [ + examples: [ 'd = [1, 2; 3, 4]', 'e = []', 'e[1, 1:2] = [5, 6]', @@ -19,7 +19,7 @@ export const subsetDocs = { 'f[2, 1]', 'f[:, 1]' ], - 'seealso': [ + seealso: [ 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'trace', 'transpose', 'zeros' ] } diff --git a/src/expression/embeddedDocs/function/matrix/trace.js b/src/expression/embeddedDocs/function/matrix/trace.js index 1d284bf11..b14315a6a 100644 --- a/src/expression/embeddedDocs/function/matrix/trace.js +++ b/src/expression/embeddedDocs/function/matrix/trace.js @@ -1,15 +1,15 @@ export const traceDocs = { - 'name': 'trace', - 'category': 'Matrix', - 'syntax': [ + name: 'trace', + category: 'Matrix', + syntax: [ 'trace(A)' ], - 'description': 'Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.', - 'examples': [ + description: 'Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.', + examples: [ 'A = [1, 2, 3; -1, 2, 3; 2, 0, 3]', 'trace(A)' ], - 'seealso': [ + seealso: [ 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'transpose', 'zeros' ] } diff --git a/src/expression/embeddedDocs/function/matrix/transpose.js b/src/expression/embeddedDocs/function/matrix/transpose.js index b7d59c1ea..61f4c6796 100644 --- a/src/expression/embeddedDocs/function/matrix/transpose.js +++ b/src/expression/embeddedDocs/function/matrix/transpose.js @@ -1,17 +1,17 @@ export const transposeDocs = { - 'name': 'transpose', - 'category': 'Matrix', - 'syntax': [ + name: 'transpose', + category: 'Matrix', + syntax: [ 'x\'', 'transpose(x)' ], - 'description': 'Transpose a matrix', - 'examples': [ + description: 'Transpose a matrix', + examples: [ 'a = [1, 2, 3; 4, 5, 6]', 'a\'', 'transpose(a)' ], - 'seealso': [ + seealso: [ 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros' ] } diff --git a/src/expression/embeddedDocs/function/matrix/zeros.js b/src/expression/embeddedDocs/function/matrix/zeros.js index 3587f11a9..ca94011b8 100644 --- a/src/expression/embeddedDocs/function/matrix/zeros.js +++ b/src/expression/embeddedDocs/function/matrix/zeros.js @@ -1,7 +1,7 @@ export const zerosDocs = { - 'name': 'zeros', - 'category': 'Matrix', - 'syntax': [ + name: 'zeros', + category: 'Matrix', + syntax: [ 'zeros(m)', 'zeros(m, n)', 'zeros(m, n, p, ...)', @@ -9,14 +9,14 @@ export const zerosDocs = { 'zeros([m, n])', 'zeros([m, n, p, ...])' ], - 'description': 'Create a matrix containing zeros.', - 'examples': [ + description: 'Create a matrix containing zeros.', + examples: [ 'zeros(3)', 'zeros(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'zeros(size(a))' ], - 'seealso': [ + seealso: [ 'concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose' ] } diff --git a/src/expression/embeddedDocs/function/probability/combinations.js b/src/expression/embeddedDocs/function/probability/combinations.js index afd6b113d..9138d5c02 100644 --- a/src/expression/embeddedDocs/function/probability/combinations.js +++ b/src/expression/embeddedDocs/function/probability/combinations.js @@ -1,12 +1,12 @@ export const combinationsDocs = { - 'name': 'combinations', - 'category': 'Probability', - 'syntax': [ + name: 'combinations', + category: 'Probability', + syntax: [ 'combinations(n, k)' ], - 'description': 'Compute the number of combinations of n items taken k at a time', - 'examples': [ + description: 'Compute the number of combinations of n items taken k at a time', + examples: [ 'combinations(7, 5)' ], - 'seealso': ['permutations', 'factorial'] + seealso: ['permutations', 'factorial'] } diff --git a/src/expression/embeddedDocs/function/probability/distribution.js b/src/expression/embeddedDocs/function/probability/distribution.js index 5bf113c41..52d9bbcff 100644 --- a/src/expression/embeddedDocs/function/probability/distribution.js +++ b/src/expression/embeddedDocs/function/probability/distribution.js @@ -1,17 +1,17 @@ export const distributionDocs = { - 'name': 'distribution', - 'category': 'Probability', - 'syntax': [ + name: 'distribution', + category: 'Probability', + syntax: [ 'distribution(name)', 'distribution(name, arg1, arg2, ...)' ], - 'description': + description: 'Create a distribution object of a specific type. ' + 'A distribution object contains functions `random([size,] [min,] [max])`, ' + '`randomInt([size,] [min,] [max])` and `pickRandom(array)`. ' + 'Available types of distributions: "uniform", "normal". ' + 'Note that the function distribution is currently not available via the expression parser.', - 'examples': [ + examples: [ ], - 'seealso': ['random', 'randomInt'] + seealso: ['random', 'randomInt'] } diff --git a/src/expression/embeddedDocs/function/probability/factorial.js b/src/expression/embeddedDocs/function/probability/factorial.js index 39c65bbce..d900e0e35 100644 --- a/src/expression/embeddedDocs/function/probability/factorial.js +++ b/src/expression/embeddedDocs/function/probability/factorial.js @@ -1,15 +1,15 @@ export const factorialDocs = { - 'name': 'factorial', - 'category': 'Probability', - 'syntax': [ + name: 'factorial', + category: 'Probability', + syntax: [ 'n!', 'factorial(n)' ], - 'description': 'Compute the factorial of a value', - 'examples': [ + description: 'Compute the factorial of a value', + examples: [ '5!', '5 * 4 * 3 * 2 * 1', '3!' ], - 'seealso': ['combinations', 'permutations', 'gamma'] + seealso: ['combinations', 'permutations', 'gamma'] } diff --git a/src/expression/embeddedDocs/function/probability/gamma.js b/src/expression/embeddedDocs/function/probability/gamma.js index 8386e5683..d99d4a191 100644 --- a/src/expression/embeddedDocs/function/probability/gamma.js +++ b/src/expression/embeddedDocs/function/probability/gamma.js @@ -1,15 +1,15 @@ export const gammaDocs = { - 'name': 'gamma', - 'category': 'Probability', - 'syntax': [ + name: 'gamma', + category: 'Probability', + syntax: [ 'gamma(n)' ], - 'description': 'Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.', - 'examples': [ + description: 'Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.', + examples: [ 'gamma(4)', '3!', 'gamma(1/2)', 'sqrt(pi)' ], - 'seealso': ['factorial'] + seealso: ['factorial'] } diff --git a/src/expression/embeddedDocs/function/probability/kldivergence.js b/src/expression/embeddedDocs/function/probability/kldivergence.js index 34c296109..c187775f2 100644 --- a/src/expression/embeddedDocs/function/probability/kldivergence.js +++ b/src/expression/embeddedDocs/function/probability/kldivergence.js @@ -1,12 +1,12 @@ export const kldivergenceDocs = { - 'name': 'kldivergence', - 'category': 'Probability', - 'syntax': [ + name: 'kldivergence', + category: 'Probability', + syntax: [ 'kldivergence(x, y)' ], - 'description': 'Calculate the Kullback-Leibler (KL) divergence between two distributions.', - 'examples': [ + description: 'Calculate the Kullback-Leibler (KL) divergence between two distributions.', + examples: [ 'kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/function/probability/multinomial.js b/src/expression/embeddedDocs/function/probability/multinomial.js index 624c743b0..94b715b7d 100644 --- a/src/expression/embeddedDocs/function/probability/multinomial.js +++ b/src/expression/embeddedDocs/function/probability/multinomial.js @@ -1,12 +1,12 @@ export const multinomialDocs = { - 'name': 'multinomial', - 'category': 'Probability', - 'syntax': [ + name: 'multinomial', + category: 'Probability', + syntax: [ 'multinomial(A)' ], - 'description': 'Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.', - 'examples': [ + description: 'Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.', + examples: [ 'multinomial([1, 2, 1])' ], - 'seealso': ['combinations', 'factorial'] + seealso: ['combinations', 'factorial'] } diff --git a/src/expression/embeddedDocs/function/probability/permutations.js b/src/expression/embeddedDocs/function/probability/permutations.js index be4e615b0..930dcafad 100644 --- a/src/expression/embeddedDocs/function/probability/permutations.js +++ b/src/expression/embeddedDocs/function/probability/permutations.js @@ -1,14 +1,14 @@ export const permutationsDocs = { - 'name': 'permutations', - 'category': 'Probability', - 'syntax': [ + name: 'permutations', + category: 'Probability', + syntax: [ 'permutations(n)', 'permutations(n, k)' ], - 'description': 'Compute the number of permutations of n items taken k at a time', - 'examples': [ + description: 'Compute the number of permutations of n items taken k at a time', + examples: [ 'permutations(5)', 'permutations(5, 3)' ], - 'seealso': ['combinations', 'factorial'] + seealso: ['combinations', 'factorial'] } diff --git a/src/expression/embeddedDocs/function/probability/pickRandom.js b/src/expression/embeddedDocs/function/probability/pickRandom.js index 8d41fc513..b888f3803 100644 --- a/src/expression/embeddedDocs/function/probability/pickRandom.js +++ b/src/expression/embeddedDocs/function/probability/pickRandom.js @@ -1,16 +1,16 @@ export const pickRandomDocs = { - 'name': 'pickRandom', - 'category': 'Probability', - 'syntax': [ + name: 'pickRandom', + category: 'Probability', + syntax: [ 'pickRandom(array)', 'pickRandom(array, number)', 'pickRandom(array, weights)', 'pickRandom(array, number, weights)', 'pickRandom(array, weights, number)' ], - 'description': + description: 'Pick a random entry from a given array.', - 'examples': [ + examples: [ 'pickRandom(0:10)', 'pickRandom([1, 3, 1, 6])', 'pickRandom([1, 3, 1, 6], 2)', @@ -18,5 +18,5 @@ export const pickRandomDocs = { 'pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)' ], - 'seealso': ['random', 'randomInt'] + seealso: ['random', 'randomInt'] } diff --git a/src/expression/embeddedDocs/function/probability/random.js b/src/expression/embeddedDocs/function/probability/random.js index 7f75e166c..f1f53e263 100644 --- a/src/expression/embeddedDocs/function/probability/random.js +++ b/src/expression/embeddedDocs/function/probability/random.js @@ -1,7 +1,7 @@ export const randomDocs = { - 'name': 'random', - 'category': 'Probability', - 'syntax': [ + name: 'random', + category: 'Probability', + syntax: [ 'random()', 'random(max)', 'random(min, max)', @@ -9,12 +9,12 @@ export const randomDocs = { 'random(size, max)', 'random(size, min, max)' ], - 'description': + description: 'Return a random number.', - 'examples': [ + examples: [ 'random()', 'random(10, 20)', 'random([2, 3])' ], - 'seealso': ['pickRandom', 'randomInt'] + seealso: ['pickRandom', 'randomInt'] } diff --git a/src/expression/embeddedDocs/function/probability/randomInt.js b/src/expression/embeddedDocs/function/probability/randomInt.js index e17cb8013..483feed1b 100644 --- a/src/expression/embeddedDocs/function/probability/randomInt.js +++ b/src/expression/embeddedDocs/function/probability/randomInt.js @@ -1,18 +1,18 @@ export const randomIntDocs = { - 'name': 'randomInt', - 'category': 'Probability', - 'syntax': [ + name: 'randomInt', + category: 'Probability', + syntax: [ 'randomInt(max)', 'randomInt(min, max)', 'randomInt(size)', 'randomInt(size, max)', 'randomInt(size, min, max)' ], - 'description': + description: 'Return a random integer number', - 'examples': [ + examples: [ 'randomInt(10, 20)', 'randomInt([2, 3], 10)' ], - 'seealso': ['pickRandom', 'random'] + seealso: ['pickRandom', 'random'] } diff --git a/src/expression/embeddedDocs/function/relational/compare.js b/src/expression/embeddedDocs/function/relational/compare.js index 175a3852f..8e33fa361 100644 --- a/src/expression/embeddedDocs/function/relational/compare.js +++ b/src/expression/embeddedDocs/function/relational/compare.js @@ -1,20 +1,20 @@ export const compareDocs = { - 'name': 'compare', - 'category': 'Relational', - 'syntax': [ + name: 'compare', + category: 'Relational', + syntax: [ 'compare(x, y)' ], - 'description': + description: 'Compare two values. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.', - 'examples': [ + examples: [ 'compare(2, 3)', 'compare(3, 2)', 'compare(2, 2)', 'compare(5cm, 40mm)', 'compare(2, [1, 2, 3])' ], - 'seealso': [ + seealso: [ 'equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compareNatural', 'compareText' ] } diff --git a/src/expression/embeddedDocs/function/relational/compareNatural.js b/src/expression/embeddedDocs/function/relational/compareNatural.js index 974219773..c37a1b3af 100644 --- a/src/expression/embeddedDocs/function/relational/compareNatural.js +++ b/src/expression/embeddedDocs/function/relational/compareNatural.js @@ -1,13 +1,13 @@ export const compareNaturalDocs = { - 'name': 'compareNatural', - 'category': 'Relational', - 'syntax': [ + name: 'compareNatural', + category: 'Relational', + syntax: [ 'compareNatural(x, y)' ], - 'description': + description: 'Compare two values of any type in a deterministic, natural way. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.', - 'examples': [ + examples: [ 'compareNatural(2, 3)', 'compareNatural(3, 2)', 'compareNatural(2, 2)', @@ -19,7 +19,7 @@ export const compareNaturalDocs = { 'compareNatural([1, 2], [1, 2])', 'compareNatural({a: 2}, {a: 4})' ], - 'seealso': [ + seealso: [ 'equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare', 'compareText' ] } diff --git a/src/expression/embeddedDocs/function/relational/compareText.js b/src/expression/embeddedDocs/function/relational/compareText.js index 6e44a6169..b0ce98231 100644 --- a/src/expression/embeddedDocs/function/relational/compareText.js +++ b/src/expression/embeddedDocs/function/relational/compareText.js @@ -1,13 +1,13 @@ export const compareTextDocs = { - 'name': 'compareText', - 'category': 'Relational', - 'syntax': [ + name: 'compareText', + category: 'Relational', + syntax: [ 'compareText(x, y)' ], - 'description': + description: 'Compare two strings lexically. Comparison is case sensitive. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.', - 'examples': [ + examples: [ 'compareText("B", "A")', 'compareText("A", "B")', 'compareText("A", "A")', @@ -17,7 +17,7 @@ export const compareTextDocs = { 'compareNatural("2", "10")', 'compareText("B", ["A", "B", "C"])' ], - 'seealso': [ + seealso: [ 'compare', 'compareNatural' ] } diff --git a/src/expression/embeddedDocs/function/relational/deepEqual.js b/src/expression/embeddedDocs/function/relational/deepEqual.js index 42a500369..cd995520b 100644 --- a/src/expression/embeddedDocs/function/relational/deepEqual.js +++ b/src/expression/embeddedDocs/function/relational/deepEqual.js @@ -1,16 +1,16 @@ export const deepEqualDocs = { - 'name': 'deepEqual', - 'category': 'Relational', - 'syntax': [ + name: 'deepEqual', + category: 'Relational', + syntax: [ 'deepEqual(x, y)' ], - 'description': + description: 'Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.', - 'examples': [ + examples: [ 'deepEqual([1,3,4], [1,3,4])', 'deepEqual([1,3,4], [1,3])' ], - 'seealso': [ + seealso: [ 'equal', 'unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare' ] } diff --git a/src/expression/embeddedDocs/function/relational/equal.js b/src/expression/embeddedDocs/function/relational/equal.js index 2c8a6581c..25a4435be 100644 --- a/src/expression/embeddedDocs/function/relational/equal.js +++ b/src/expression/embeddedDocs/function/relational/equal.js @@ -1,13 +1,13 @@ export const equalDocs = { - 'name': 'equal', - 'category': 'Relational', - 'syntax': [ + name: 'equal', + category: 'Relational', + syntax: [ 'x == y', 'equal(x, y)' ], - 'description': + description: 'Check equality of two values. Returns true if the values are equal, and false if not.', - 'examples': [ + examples: [ '2+2 == 3', '2+2 == 4', 'a = 3.2', @@ -15,7 +15,7 @@ export const equalDocs = { 'a == b', '50cm == 0.5m' ], - 'seealso': [ + seealso: [ 'unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual', 'equalText' ] } diff --git a/src/expression/embeddedDocs/function/relational/equalText.js b/src/expression/embeddedDocs/function/relational/equalText.js index 93d0cfbda..54c85be4f 100644 --- a/src/expression/embeddedDocs/function/relational/equalText.js +++ b/src/expression/embeddedDocs/function/relational/equalText.js @@ -1,19 +1,19 @@ export const equalTextDocs = { - 'name': 'equalText', - 'category': 'Relational', - 'syntax': [ + name: 'equalText', + category: 'Relational', + syntax: [ 'equalText(x, y)' ], - 'description': + description: 'Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.', - 'examples': [ + examples: [ 'equalText("Hello", "Hello")', 'equalText("a", "A")', 'equal("2e3", "2000")', 'equalText("2e3", "2000")', 'equalText("B", ["A", "B", "C"])' ], - 'seealso': [ + seealso: [ 'compare', 'compareNatural', 'compareText', 'equal' ] } diff --git a/src/expression/embeddedDocs/function/relational/larger.js b/src/expression/embeddedDocs/function/relational/larger.js index e20671ea4..3eaab171f 100644 --- a/src/expression/embeddedDocs/function/relational/larger.js +++ b/src/expression/embeddedDocs/function/relational/larger.js @@ -1,13 +1,13 @@ export const largerDocs = { - 'name': 'larger', - 'category': 'Relational', - 'syntax': [ + name: 'larger', + category: 'Relational', + syntax: [ 'x > y', 'larger(x, y)' ], - 'description': + description: 'Check if value x is larger than y. Returns true if x is larger than y, and false if not.', - 'examples': [ + examples: [ '2 > 3', '5 > 2*2', 'a = 3.3', @@ -16,7 +16,7 @@ export const largerDocs = { '(b < a)', '5 cm > 2 inch' ], - 'seealso': [ + seealso: [ 'equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare' ] } diff --git a/src/expression/embeddedDocs/function/relational/largerEq.js b/src/expression/embeddedDocs/function/relational/largerEq.js index 939edaa42..20d7b44d8 100644 --- a/src/expression/embeddedDocs/function/relational/largerEq.js +++ b/src/expression/embeddedDocs/function/relational/largerEq.js @@ -1,20 +1,20 @@ export const largerEqDocs = { - 'name': 'largerEq', - 'category': 'Relational', - 'syntax': [ + name: 'largerEq', + category: 'Relational', + syntax: [ 'x >= y', 'largerEq(x, y)' ], - 'description': + description: 'Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.', - 'examples': [ + examples: [ '2 >= 1+1', '2 > 1+1', 'a = 3.2', 'b = 6-2.8', '(a >= b)' ], - 'seealso': [ + seealso: [ 'equal', 'unequal', 'smallerEq', 'smaller', 'compare' ] } diff --git a/src/expression/embeddedDocs/function/relational/smaller.js b/src/expression/embeddedDocs/function/relational/smaller.js index d736d4633..215b3eb30 100644 --- a/src/expression/embeddedDocs/function/relational/smaller.js +++ b/src/expression/embeddedDocs/function/relational/smaller.js @@ -1,13 +1,13 @@ export const smallerDocs = { - 'name': 'smaller', - 'category': 'Relational', - 'syntax': [ + name: 'smaller', + category: 'Relational', + syntax: [ 'x < y', 'smaller(x, y)' ], - 'description': + description: 'Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.', - 'examples': [ + examples: [ '2 < 3', '5 < 2*2', 'a = 3.3', @@ -15,7 +15,7 @@ export const smallerDocs = { '(a < b)', '5 cm < 2 inch' ], - 'seealso': [ + seealso: [ 'equal', 'unequal', 'larger', 'smallerEq', 'largerEq', 'compare' ] } diff --git a/src/expression/embeddedDocs/function/relational/smallerEq.js b/src/expression/embeddedDocs/function/relational/smallerEq.js index 783d9cdc7..d83071151 100644 --- a/src/expression/embeddedDocs/function/relational/smallerEq.js +++ b/src/expression/embeddedDocs/function/relational/smallerEq.js @@ -1,20 +1,20 @@ export const smallerEqDocs = { - 'name': 'smallerEq', - 'category': 'Relational', - 'syntax': [ + name: 'smallerEq', + category: 'Relational', + syntax: [ 'x <= y', 'smallerEq(x, y)' ], - 'description': + description: 'Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.', - 'examples': [ + examples: [ '2 <= 1+1', '2 < 1+1', 'a = 3.2', 'b = 6-2.8', '(a <= b)' ], - 'seealso': [ + seealso: [ 'equal', 'unequal', 'larger', 'smaller', 'largerEq', 'compare' ] } diff --git a/src/expression/embeddedDocs/function/relational/unequal.js b/src/expression/embeddedDocs/function/relational/unequal.js index 2e87000f3..69f3e2f4a 100644 --- a/src/expression/embeddedDocs/function/relational/unequal.js +++ b/src/expression/embeddedDocs/function/relational/unequal.js @@ -1,13 +1,13 @@ export const unequalDocs = { - 'name': 'unequal', - 'category': 'Relational', - 'syntax': [ + name: 'unequal', + category: 'Relational', + syntax: [ 'x != y', 'unequal(x, y)' ], - 'description': + description: 'Check unequality of two values. Returns true if the values are unequal, and false if they are equal.', - 'examples': [ + examples: [ '2+2 != 3', '2+2 != 4', 'a = 3.2', @@ -16,7 +16,7 @@ export const unequalDocs = { '50cm != 0.5m', '5 cm != 2 inch' ], - 'seealso': [ + seealso: [ 'equal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual' ] } diff --git a/src/expression/embeddedDocs/function/set/setCartesian.js b/src/expression/embeddedDocs/function/set/setCartesian.js index 73ce2cb92..320109915 100644 --- a/src/expression/embeddedDocs/function/set/setCartesian.js +++ b/src/expression/embeddedDocs/function/set/setCartesian.js @@ -1,15 +1,15 @@ export const setCartesianDocs = { - 'name': 'setCartesian', - 'category': 'Set', - 'syntax': [ + name: 'setCartesian', + category: 'Set', + syntax: [ 'setCartesian(set1, set2)' ], - 'description': + description: 'Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', - 'examples': [ + examples: [ 'setCartesian([1, 2], [3, 4])' ], - 'seealso': [ + seealso: [ 'setUnion', 'setIntersect', 'setDifference', 'setPowerset' ] } diff --git a/src/expression/embeddedDocs/function/set/setDifference.js b/src/expression/embeddedDocs/function/set/setDifference.js index cab099d54..09011bcb0 100644 --- a/src/expression/embeddedDocs/function/set/setDifference.js +++ b/src/expression/embeddedDocs/function/set/setDifference.js @@ -1,16 +1,16 @@ export const setDifferenceDocs = { - 'name': 'setDifference', - 'category': 'Set', - 'syntax': [ + name: 'setDifference', + category: 'Set', + syntax: [ 'setDifference(set1, set2)' ], - 'description': + description: 'Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', - 'examples': [ + examples: [ 'setDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])' ], - 'seealso': [ + seealso: [ 'setUnion', 'setIntersect', 'setSymDifference' ] } diff --git a/src/expression/embeddedDocs/function/set/setDistinct.js b/src/expression/embeddedDocs/function/set/setDistinct.js index dfd6c92b1..c0121dfb6 100644 --- a/src/expression/embeddedDocs/function/set/setDistinct.js +++ b/src/expression/embeddedDocs/function/set/setDistinct.js @@ -1,15 +1,15 @@ export const setDistinctDocs = { - 'name': 'setDistinct', - 'category': 'Set', - 'syntax': [ + name: 'setDistinct', + category: 'Set', + syntax: [ 'setDistinct(set)' ], - 'description': + description: 'Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.', - 'examples': [ + examples: [ 'setDistinct([1, 1, 1, 2, 2, 3])' ], - 'seealso': [ + seealso: [ 'setMultiplicity' ] } diff --git a/src/expression/embeddedDocs/function/set/setIntersect.js b/src/expression/embeddedDocs/function/set/setIntersect.js index 1728fc954..bd7116b3a 100644 --- a/src/expression/embeddedDocs/function/set/setIntersect.js +++ b/src/expression/embeddedDocs/function/set/setIntersect.js @@ -1,16 +1,16 @@ export const setIntersectDocs = { - 'name': 'setIntersect', - 'category': 'Set', - 'syntax': [ + name: 'setIntersect', + category: 'Set', + syntax: [ 'setIntersect(set1, set2)' ], - 'description': + description: 'Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', - 'examples': [ + examples: [ 'setIntersect([1, 2, 3, 4], [3, 4, 5, 6])', 'setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])' ], - 'seealso': [ + seealso: [ 'setUnion', 'setDifference' ] } diff --git a/src/expression/embeddedDocs/function/set/setIsSubset.js b/src/expression/embeddedDocs/function/set/setIsSubset.js index 460b23ddc..2719f8ead 100644 --- a/src/expression/embeddedDocs/function/set/setIsSubset.js +++ b/src/expression/embeddedDocs/function/set/setIsSubset.js @@ -1,16 +1,16 @@ export const setIsSubsetDocs = { - 'name': 'setIsSubset', - 'category': 'Set', - 'syntax': [ + name: 'setIsSubset', + category: 'Set', + syntax: [ 'setIsSubset(set1, set2)' ], - 'description': + description: 'Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', - 'examples': [ + examples: [ 'setIsSubset([1, 2], [3, 4, 5, 6])', 'setIsSubset([3, 4], [3, 4, 5, 6])' ], - 'seealso': [ + seealso: [ 'setUnion', 'setIntersect', 'setDifference' ] } diff --git a/src/expression/embeddedDocs/function/set/setMultiplicity.js b/src/expression/embeddedDocs/function/set/setMultiplicity.js index c1361338c..71f77a296 100644 --- a/src/expression/embeddedDocs/function/set/setMultiplicity.js +++ b/src/expression/embeddedDocs/function/set/setMultiplicity.js @@ -1,16 +1,16 @@ export const setMultiplicityDocs = { - 'name': 'setMultiplicity', - 'category': 'Set', - 'syntax': [ + name: 'setMultiplicity', + category: 'Set', + syntax: [ 'setMultiplicity(element, set)' ], - 'description': + description: 'Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.', - 'examples': [ + examples: [ 'setMultiplicity(1, [1, 2, 2, 4])', 'setMultiplicity(2, [1, 2, 2, 4])' ], - 'seealso': [ + seealso: [ 'setDistinct', 'setSize' ] } diff --git a/src/expression/embeddedDocs/function/set/setPowerset.js b/src/expression/embeddedDocs/function/set/setPowerset.js index dfb38e5a6..cfa1ab1e8 100644 --- a/src/expression/embeddedDocs/function/set/setPowerset.js +++ b/src/expression/embeddedDocs/function/set/setPowerset.js @@ -1,15 +1,15 @@ export const setPowersetDocs = { - 'name': 'setPowerset', - 'category': 'Set', - 'syntax': [ + name: 'setPowerset', + category: 'Set', + syntax: [ 'setPowerset(set)' ], - 'description': + description: 'Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.', - 'examples': [ + examples: [ 'setPowerset([1, 2, 3])' ], - 'seealso': [ + seealso: [ 'setCartesian' ] } diff --git a/src/expression/embeddedDocs/function/set/setSize.js b/src/expression/embeddedDocs/function/set/setSize.js index ef6a358d9..7d0da427d 100644 --- a/src/expression/embeddedDocs/function/set/setSize.js +++ b/src/expression/embeddedDocs/function/set/setSize.js @@ -1,17 +1,17 @@ export const setSizeDocs = { - 'name': 'setSize', - 'category': 'Set', - 'syntax': [ + name: 'setSize', + category: 'Set', + syntax: [ 'setSize(set)', 'setSize(set, unique)' ], - 'description': + description: 'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.', - 'examples': [ + examples: [ 'setSize([1, 2, 2, 4])', 'setSize([1, 2, 2, 4], true)' ], - 'seealso': [ + seealso: [ 'setUnion', 'setIntersect', 'setDifference' ] } diff --git a/src/expression/embeddedDocs/function/set/setSymDifference.js b/src/expression/embeddedDocs/function/set/setSymDifference.js index 54d66fbae..91447f16a 100644 --- a/src/expression/embeddedDocs/function/set/setSymDifference.js +++ b/src/expression/embeddedDocs/function/set/setSymDifference.js @@ -1,16 +1,16 @@ export const setSymDifferenceDocs = { - 'name': 'setSymDifference', - 'category': 'Set', - 'syntax': [ + name: 'setSymDifference', + category: 'Set', + syntax: [ 'setSymDifference(set1, set2)' ], - 'description': + description: 'Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', - 'examples': [ + examples: [ 'setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])' ], - 'seealso': [ + seealso: [ 'setUnion', 'setIntersect', 'setDifference' ] } diff --git a/src/expression/embeddedDocs/function/set/setUnion.js b/src/expression/embeddedDocs/function/set/setUnion.js index 4feb093e2..3ddfc0526 100644 --- a/src/expression/embeddedDocs/function/set/setUnion.js +++ b/src/expression/embeddedDocs/function/set/setUnion.js @@ -1,16 +1,16 @@ export const setUnionDocs = { - 'name': 'setUnion', - 'category': 'Set', - 'syntax': [ + name: 'setUnion', + category: 'Set', + syntax: [ 'setUnion(set1, set2)' ], - 'description': + description: 'Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.', - 'examples': [ + examples: [ 'setUnion([1, 2, 3, 4], [3, 4, 5, 6])', 'setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])' ], - 'seealso': [ + seealso: [ 'setIntersect', 'setDifference' ] } diff --git a/src/expression/embeddedDocs/function/special/erf.js b/src/expression/embeddedDocs/function/special/erf.js index a200a4dbc..be32abf46 100644 --- a/src/expression/embeddedDocs/function/special/erf.js +++ b/src/expression/embeddedDocs/function/special/erf.js @@ -1,14 +1,14 @@ export const erfDocs = { - 'name': 'erf', - 'category': 'Special', - 'syntax': [ + name: 'erf', + category: 'Special', + syntax: [ 'erf(x)' ], - 'description': 'Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x', - 'examples': [ + description: 'Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x', + examples: [ 'erf(0.2)', 'erf(-0.5)', 'erf(4)' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/function/statistics/mad.js b/src/expression/embeddedDocs/function/statistics/mad.js index b4b21469d..ee0b5a245 100644 --- a/src/expression/embeddedDocs/function/statistics/mad.js +++ b/src/expression/embeddedDocs/function/statistics/mad.js @@ -1,16 +1,16 @@ export const madDocs = { - 'name': 'mad', - 'category': 'Statistics', - 'syntax': [ + name: 'mad', + category: 'Statistics', + syntax: [ 'mad(a, b, c, ...)', 'mad(A)' ], - 'description': 'Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.', - 'examples': [ + description: 'Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.', + examples: [ 'mad(10, 20, 30)', 'mad([1, 2, 3])' ], - 'seealso': [ + seealso: [ 'mean', 'median', 'std', diff --git a/src/expression/embeddedDocs/function/statistics/max.js b/src/expression/embeddedDocs/function/statistics/max.js index 6bf7ad05e..f053e2f5c 100644 --- a/src/expression/embeddedDocs/function/statistics/max.js +++ b/src/expression/embeddedDocs/function/statistics/max.js @@ -1,13 +1,13 @@ export const maxDocs = { - 'name': 'max', - 'category': 'Statistics', - 'syntax': [ + name: 'max', + category: 'Statistics', + syntax: [ 'max(a, b, c, ...)', 'max(A)', 'max(A, dim)' ], - 'description': 'Compute the maximum value of a list of values.', - 'examples': [ + description: 'Compute the maximum value of a list of values.', + examples: [ 'max(2, 3, 4, 1)', 'max([2, 3, 4, 1])', 'max([2, 5; 4, 3])', @@ -16,7 +16,7 @@ export const maxDocs = { 'max(2.7, 7.1, -4.5, 2.0, 4.1)', 'min(2.7, 7.1, -4.5, 2.0, 4.1)' ], - 'seealso': [ + seealso: [ 'mean', 'median', 'min', diff --git a/src/expression/embeddedDocs/function/statistics/mean.js b/src/expression/embeddedDocs/function/statistics/mean.js index 97ebed106..3daacbf3f 100644 --- a/src/expression/embeddedDocs/function/statistics/mean.js +++ b/src/expression/embeddedDocs/function/statistics/mean.js @@ -1,13 +1,13 @@ export const meanDocs = { - 'name': 'mean', - 'category': 'Statistics', - 'syntax': [ + name: 'mean', + category: 'Statistics', + syntax: [ 'mean(a, b, c, ...)', 'mean(A)', 'mean(A, dim)' ], - 'description': 'Compute the arithmetic mean of a list of values.', - 'examples': [ + description: 'Compute the arithmetic mean of a list of values.', + examples: [ 'mean(2, 3, 4, 1)', 'mean([2, 3, 4, 1])', 'mean([2, 5; 4, 3])', @@ -15,7 +15,7 @@ export const meanDocs = { 'mean([2, 5; 4, 3], 2)', 'mean([1.0, 2.7, 3.2, 4.0])' ], - 'seealso': [ + seealso: [ 'max', 'median', 'min', diff --git a/src/expression/embeddedDocs/function/statistics/median.js b/src/expression/embeddedDocs/function/statistics/median.js index 469bfa3f3..da38ac6da 100644 --- a/src/expression/embeddedDocs/function/statistics/median.js +++ b/src/expression/embeddedDocs/function/statistics/median.js @@ -1,16 +1,16 @@ export const medianDocs = { - 'name': 'median', - 'category': 'Statistics', - 'syntax': [ + name: 'median', + category: 'Statistics', + syntax: [ 'median(a, b, c, ...)', 'median(A)' ], - 'description': 'Compute the median of all 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.', - 'examples': [ + description: 'Compute the median of all 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.', + examples: [ 'median(5, 2, 7)', 'median([3, -1, 5, 7])' ], - 'seealso': [ + seealso: [ 'max', 'mean', 'min', diff --git a/src/expression/embeddedDocs/function/statistics/min.js b/src/expression/embeddedDocs/function/statistics/min.js index 0586549d3..f4ca91f24 100644 --- a/src/expression/embeddedDocs/function/statistics/min.js +++ b/src/expression/embeddedDocs/function/statistics/min.js @@ -1,13 +1,13 @@ export const minDocs = { - 'name': 'min', - 'category': 'Statistics', - 'syntax': [ + name: 'min', + category: 'Statistics', + syntax: [ 'min(a, b, c, ...)', 'min(A)', 'min(A, dim)' ], - 'description': 'Compute the minimum value of a list of values.', - 'examples': [ + description: 'Compute the minimum value of a list of values.', + examples: [ 'min(2, 3, 4, 1)', 'min([2, 3, 4, 1])', 'min([2, 5; 4, 3])', @@ -16,7 +16,7 @@ export const minDocs = { 'min(2.7, 7.1, -4.5, 2.0, 4.1)', 'max(2.7, 7.1, -4.5, 2.0, 4.1)' ], - 'seealso': [ + seealso: [ 'max', 'mean', 'median', diff --git a/src/expression/embeddedDocs/function/statistics/mode.js b/src/expression/embeddedDocs/function/statistics/mode.js index fd1ef8edb..18d0fe58b 100644 --- a/src/expression/embeddedDocs/function/statistics/mode.js +++ b/src/expression/embeddedDocs/function/statistics/mode.js @@ -1,18 +1,18 @@ export const modeDocs = { - 'name': 'mode', - 'category': 'Statistics', - 'syntax': [ + name: 'mode', + category: 'Statistics', + syntax: [ 'mode(a, b, c, ...)', 'mode(A)', 'mode(A, a, b, B, c, ...)' ], - 'description': 'Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.', - 'examples': [ + description: 'Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.', + examples: [ 'mode(2, 1, 4, 3, 1)', 'mode([1, 2.7, 3.2, 4, 2.7])', 'mode(1, 4, 6, 1, 6)' ], - 'seealso': [ + seealso: [ 'max', 'mean', 'min', diff --git a/src/expression/embeddedDocs/function/statistics/prod.js b/src/expression/embeddedDocs/function/statistics/prod.js index 63eeac9e5..b69060a03 100644 --- a/src/expression/embeddedDocs/function/statistics/prod.js +++ b/src/expression/embeddedDocs/function/statistics/prod.js @@ -1,17 +1,17 @@ export const prodDocs = { - 'name': 'prod', - 'category': 'Statistics', - 'syntax': [ + name: 'prod', + category: 'Statistics', + syntax: [ 'prod(a, b, c, ...)', 'prod(A)' ], - 'description': 'Compute the product of all values.', - 'examples': [ + description: 'Compute the product of all values.', + examples: [ 'prod(2, 3, 4)', 'prod([2, 3, 4])', 'prod([2, 5; 4, 3])' ], - 'seealso': [ + seealso: [ 'max', 'mean', 'min', diff --git a/src/expression/embeddedDocs/function/statistics/quantileSeq.js b/src/expression/embeddedDocs/function/statistics/quantileSeq.js index 0a254a7d6..e6a9e421a 100644 --- a/src/expression/embeddedDocs/function/statistics/quantileSeq.js +++ b/src/expression/embeddedDocs/function/statistics/quantileSeq.js @@ -1,19 +1,19 @@ export const quantileSeqDocs = { - 'name': 'quantileSeq', - 'category': 'Statistics', - 'syntax': [ + name: 'quantileSeq', + category: 'Statistics', + syntax: [ 'quantileSeq(A, prob[, sorted])', 'quantileSeq(A, [prob1, prob2, ...][, sorted])', 'quantileSeq(A, N[, sorted])' ], - 'description': 'Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.', - 'examples': [ + description: 'Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.', + examples: [ 'quantileSeq([3, -1, 5, 7], 0.5)', 'quantileSeq([3, -1, 5, 7], [1/3, 2/3])', 'quantileSeq([3, -1, 5, 7], 2)', 'quantileSeq([-1, 3, 5, 7], 0.5, true)' ], - 'seealso': [ + seealso: [ 'mean', 'median', 'min', diff --git a/src/expression/embeddedDocs/function/statistics/std.js b/src/expression/embeddedDocs/function/statistics/std.js index 2272e23e3..be6b9d5b0 100644 --- a/src/expression/embeddedDocs/function/statistics/std.js +++ b/src/expression/embeddedDocs/function/statistics/std.js @@ -1,20 +1,20 @@ export const stdDocs = { - 'name': 'std', - 'category': 'Statistics', - 'syntax': [ + name: 'std', + category: 'Statistics', + syntax: [ 'std(a, b, c, ...)', 'std(A)', 'std(A, normalization)' ], - 'description': 'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".', - 'examples': [ + description: 'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".', + examples: [ 'std(2, 4, 6)', 'std([2, 4, 6, 8])', 'std([2, 4, 6, 8], "uncorrected")', 'std([2, 4, 6, 8], "biased")', 'std([1, 2, 3; 4, 5, 6])' ], - 'seealso': [ + seealso: [ 'max', 'mean', 'min', diff --git a/src/expression/embeddedDocs/function/statistics/sum.js b/src/expression/embeddedDocs/function/statistics/sum.js index 37b4c7397..a1c75d936 100644 --- a/src/expression/embeddedDocs/function/statistics/sum.js +++ b/src/expression/embeddedDocs/function/statistics/sum.js @@ -1,17 +1,17 @@ export const sumDocs = { - 'name': 'sum', - 'category': 'Statistics', - 'syntax': [ + name: 'sum', + category: 'Statistics', + syntax: [ 'sum(a, b, c, ...)', 'sum(A)' ], - 'description': 'Compute the sum of all values.', - 'examples': [ + description: 'Compute the sum of all values.', + examples: [ 'sum(2, 3, 4, 1)', 'sum([2, 3, 4, 1])', 'sum([2, 5; 4, 3])' ], - 'seealso': [ + seealso: [ 'max', 'mean', 'median', diff --git a/src/expression/embeddedDocs/function/statistics/variance.js b/src/expression/embeddedDocs/function/statistics/variance.js index 388ba7bb8..7f37b799a 100644 --- a/src/expression/embeddedDocs/function/statistics/variance.js +++ b/src/expression/embeddedDocs/function/statistics/variance.js @@ -1,20 +1,20 @@ export const varianceDocs = { - 'name': 'variance', - 'category': 'Statistics', - 'syntax': [ + name: 'variance', + category: 'Statistics', + syntax: [ 'variance(a, b, c, ...)', 'variance(A)', 'variance(A, normalization)' ], - 'description': 'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".', - 'examples': [ + description: 'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".', + examples: [ 'variance(2, 4, 6)', 'variance([2, 4, 6, 8])', 'variance([2, 4, 6, 8], "uncorrected")', 'variance([2, 4, 6, 8], "biased")', 'variance([1, 2, 3; 4, 5, 6])' ], - 'seealso': [ + seealso: [ 'max', 'mean', 'min', diff --git a/src/expression/embeddedDocs/function/trigonometry/acos.js b/src/expression/embeddedDocs/function/trigonometry/acos.js index 0336590a2..cdb10e8a2 100644 --- a/src/expression/embeddedDocs/function/trigonometry/acos.js +++ b/src/expression/embeddedDocs/function/trigonometry/acos.js @@ -1,15 +1,15 @@ export const acosDocs = { - 'name': 'acos', - 'category': 'Trigonometry', - 'syntax': [ + name: 'acos', + category: 'Trigonometry', + syntax: [ 'acos(x)' ], - 'description': 'Compute the inverse cosine of a value in radians.', - 'examples': [ + description: 'Compute the inverse cosine of a value in radians.', + examples: [ 'acos(0.5)', 'acos(cos(2.3))' ], - 'seealso': [ + seealso: [ 'cos', 'atan', 'asin' diff --git a/src/expression/embeddedDocs/function/trigonometry/acosh.js b/src/expression/embeddedDocs/function/trigonometry/acosh.js index c32f293c7..c14b0ec93 100644 --- a/src/expression/embeddedDocs/function/trigonometry/acosh.js +++ b/src/expression/embeddedDocs/function/trigonometry/acosh.js @@ -1,14 +1,14 @@ export const acoshDocs = { - 'name': 'acosh', - 'category': 'Trigonometry', - 'syntax': [ + name: 'acosh', + category: 'Trigonometry', + syntax: [ 'acosh(x)' ], - 'description': 'Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.', - 'examples': [ + description: 'Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.', + examples: [ 'acosh(1.5)' ], - 'seealso': [ + seealso: [ 'cosh', 'asinh', 'atanh' diff --git a/src/expression/embeddedDocs/function/trigonometry/acot.js b/src/expression/embeddedDocs/function/trigonometry/acot.js index be67cb4be..71b798d15 100644 --- a/src/expression/embeddedDocs/function/trigonometry/acot.js +++ b/src/expression/embeddedDocs/function/trigonometry/acot.js @@ -1,16 +1,16 @@ export const acotDocs = { - 'name': 'acot', - 'category': 'Trigonometry', - 'syntax': [ + name: 'acot', + category: 'Trigonometry', + syntax: [ 'acot(x)' ], - 'description': 'Calculate the inverse cotangent of a value.', - 'examples': [ + description: 'Calculate the inverse cotangent of a value.', + examples: [ 'acot(0.5)', 'acot(cot(0.5))', 'acot(2)' ], - 'seealso': [ + seealso: [ 'cot', 'atan' ] diff --git a/src/expression/embeddedDocs/function/trigonometry/acoth.js b/src/expression/embeddedDocs/function/trigonometry/acoth.js index c8a470470..866ff24ef 100644 --- a/src/expression/embeddedDocs/function/trigonometry/acoth.js +++ b/src/expression/embeddedDocs/function/trigonometry/acoth.js @@ -1,15 +1,15 @@ export const acothDocs = { - 'name': 'acoth', - 'category': 'Trigonometry', - 'syntax': [ + name: 'acoth', + category: 'Trigonometry', + syntax: [ 'acoth(x)' ], - 'description': 'Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.', - 'examples': [ + description: 'Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.', + examples: [ 'acoth(2)', 'acoth(0.5)' ], - 'seealso': [ + seealso: [ 'acsch', 'asech' ] diff --git a/src/expression/embeddedDocs/function/trigonometry/acsc.js b/src/expression/embeddedDocs/function/trigonometry/acsc.js index ad4435cca..3cb23570d 100644 --- a/src/expression/embeddedDocs/function/trigonometry/acsc.js +++ b/src/expression/embeddedDocs/function/trigonometry/acsc.js @@ -1,16 +1,16 @@ export const acscDocs = { - 'name': 'acsc', - 'category': 'Trigonometry', - 'syntax': [ + name: 'acsc', + category: 'Trigonometry', + syntax: [ 'acsc(x)' ], - 'description': 'Calculate the inverse cotangent of a value.', - 'examples': [ + description: 'Calculate the inverse cotangent of a value.', + examples: [ 'acsc(2)', 'acsc(csc(0.5))', 'acsc(0.5)' ], - 'seealso': [ + seealso: [ 'csc', 'asin', 'asec' diff --git a/src/expression/embeddedDocs/function/trigonometry/acsch.js b/src/expression/embeddedDocs/function/trigonometry/acsch.js index e917fc289..3b69b9667 100644 --- a/src/expression/embeddedDocs/function/trigonometry/acsch.js +++ b/src/expression/embeddedDocs/function/trigonometry/acsch.js @@ -1,14 +1,14 @@ export const acschDocs = { - 'name': 'acsch', - 'category': 'Trigonometry', - 'syntax': [ + name: 'acsch', + category: 'Trigonometry', + syntax: [ 'acsch(x)' ], - 'description': 'Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.', - 'examples': [ + description: 'Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.', + examples: [ 'acsch(0.5)' ], - 'seealso': [ + seealso: [ 'asech', 'acoth' ] diff --git a/src/expression/embeddedDocs/function/trigonometry/asec.js b/src/expression/embeddedDocs/function/trigonometry/asec.js index 19b75b192..1a729754c 100644 --- a/src/expression/embeddedDocs/function/trigonometry/asec.js +++ b/src/expression/embeddedDocs/function/trigonometry/asec.js @@ -1,16 +1,16 @@ export const asecDocs = { - 'name': 'asec', - 'category': 'Trigonometry', - 'syntax': [ + name: 'asec', + category: 'Trigonometry', + syntax: [ 'asec(x)' ], - 'description': 'Calculate the inverse secant of a value.', - 'examples': [ + description: 'Calculate the inverse secant of a value.', + examples: [ 'asec(0.5)', 'asec(sec(0.5))', 'asec(2)' ], - 'seealso': [ + seealso: [ 'acos', 'acot', 'acsc' diff --git a/src/expression/embeddedDocs/function/trigonometry/asech.js b/src/expression/embeddedDocs/function/trigonometry/asech.js index ab0993f0e..bacee9ca4 100644 --- a/src/expression/embeddedDocs/function/trigonometry/asech.js +++ b/src/expression/embeddedDocs/function/trigonometry/asech.js @@ -1,14 +1,14 @@ export const asechDocs = { - 'name': 'asech', - 'category': 'Trigonometry', - 'syntax': [ + name: 'asech', + category: 'Trigonometry', + syntax: [ 'asech(x)' ], - 'description': 'Calculate the inverse secant of a value.', - 'examples': [ + description: 'Calculate the inverse secant of a value.', + examples: [ 'asech(0.5)' ], - 'seealso': [ + seealso: [ 'acsch', 'acoth' ] diff --git a/src/expression/embeddedDocs/function/trigonometry/asin.js b/src/expression/embeddedDocs/function/trigonometry/asin.js index 05bcbc361..a0d30c77f 100644 --- a/src/expression/embeddedDocs/function/trigonometry/asin.js +++ b/src/expression/embeddedDocs/function/trigonometry/asin.js @@ -1,15 +1,15 @@ export const asinDocs = { - 'name': 'asin', - 'category': 'Trigonometry', - 'syntax': [ + name: 'asin', + category: 'Trigonometry', + syntax: [ 'asin(x)' ], - 'description': 'Compute the inverse sine of a value in radians.', - 'examples': [ + description: 'Compute the inverse sine of a value in radians.', + examples: [ 'asin(0.5)', 'asin(sin(0.5))' ], - 'seealso': [ + seealso: [ 'sin', 'acos', 'atan' diff --git a/src/expression/embeddedDocs/function/trigonometry/asinh.js b/src/expression/embeddedDocs/function/trigonometry/asinh.js index c3abe52d8..ac7f68438 100644 --- a/src/expression/embeddedDocs/function/trigonometry/asinh.js +++ b/src/expression/embeddedDocs/function/trigonometry/asinh.js @@ -1,14 +1,14 @@ export const asinhDocs = { - 'name': 'asinh', - 'category': 'Trigonometry', - 'syntax': [ + name: 'asinh', + category: 'Trigonometry', + syntax: [ 'asinh(x)' ], - 'description': 'Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.', - 'examples': [ + description: 'Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.', + examples: [ 'asinh(0.5)' ], - 'seealso': [ + seealso: [ 'acosh', 'atanh' ] diff --git a/src/expression/embeddedDocs/function/trigonometry/atan.js b/src/expression/embeddedDocs/function/trigonometry/atan.js index 3c0be7676..21dc2680f 100644 --- a/src/expression/embeddedDocs/function/trigonometry/atan.js +++ b/src/expression/embeddedDocs/function/trigonometry/atan.js @@ -1,15 +1,15 @@ export const atanDocs = { - 'name': 'atan', - 'category': 'Trigonometry', - 'syntax': [ + name: 'atan', + category: 'Trigonometry', + syntax: [ 'atan(x)' ], - 'description': 'Compute the inverse tangent of a value in radians.', - 'examples': [ + description: 'Compute the inverse tangent of a value in radians.', + examples: [ 'atan(0.5)', 'atan(tan(0.5))' ], - 'seealso': [ + seealso: [ 'tan', 'acos', 'asin' diff --git a/src/expression/embeddedDocs/function/trigonometry/atan2.js b/src/expression/embeddedDocs/function/trigonometry/atan2.js index a689923d3..12fb59f52 100644 --- a/src/expression/embeddedDocs/function/trigonometry/atan2.js +++ b/src/expression/embeddedDocs/function/trigonometry/atan2.js @@ -1,19 +1,19 @@ export const atan2Docs = { - 'name': 'atan2', - 'category': 'Trigonometry', - 'syntax': [ + name: 'atan2', + category: 'Trigonometry', + syntax: [ 'atan2(y, x)' ], - 'description': + description: 'Computes the principal value of the arc tangent of y/x in radians.', - 'examples': [ + examples: [ 'atan2(2, 2) / pi', 'angle = 60 deg in rad', 'x = cos(angle)', 'y = sin(angle)', 'atan2(y, x)' ], - 'seealso': [ + seealso: [ 'sin', 'cos', 'tan' diff --git a/src/expression/embeddedDocs/function/trigonometry/atanh.js b/src/expression/embeddedDocs/function/trigonometry/atanh.js index b0a6f47ab..86b476527 100644 --- a/src/expression/embeddedDocs/function/trigonometry/atanh.js +++ b/src/expression/embeddedDocs/function/trigonometry/atanh.js @@ -1,14 +1,14 @@ export const atanhDocs = { - 'name': 'atanh', - 'category': 'Trigonometry', - 'syntax': [ + name: 'atanh', + category: 'Trigonometry', + syntax: [ 'atanh(x)' ], - 'description': 'Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.', - 'examples': [ + description: 'Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.', + examples: [ 'atanh(0.5)' ], - 'seealso': [ + seealso: [ 'acosh', 'asinh' ] diff --git a/src/expression/embeddedDocs/function/trigonometry/cos.js b/src/expression/embeddedDocs/function/trigonometry/cos.js index 0e71b8727..0ee3c972f 100644 --- a/src/expression/embeddedDocs/function/trigonometry/cos.js +++ b/src/expression/embeddedDocs/function/trigonometry/cos.js @@ -1,18 +1,18 @@ export const cosDocs = { - 'name': 'cos', - 'category': 'Trigonometry', - 'syntax': [ + name: 'cos', + category: 'Trigonometry', + syntax: [ 'cos(x)' ], - 'description': 'Compute the cosine of x in radians.', - 'examples': [ + description: 'Compute the cosine of x in radians.', + examples: [ 'cos(2)', 'cos(pi / 4) ^ 2', 'cos(180 deg)', 'cos(60 deg)', 'sin(0.2)^2 + cos(0.2)^2' ], - 'seealso': [ + seealso: [ 'acos', 'sin', 'tan' diff --git a/src/expression/embeddedDocs/function/trigonometry/cosh.js b/src/expression/embeddedDocs/function/trigonometry/cosh.js index 705e779e0..30b90ea36 100644 --- a/src/expression/embeddedDocs/function/trigonometry/cosh.js +++ b/src/expression/embeddedDocs/function/trigonometry/cosh.js @@ -1,14 +1,14 @@ export const coshDocs = { - 'name': 'cosh', - 'category': 'Trigonometry', - 'syntax': [ + name: 'cosh', + category: 'Trigonometry', + syntax: [ 'cosh(x)' ], - 'description': 'Compute the hyperbolic cosine of x in radians.', - 'examples': [ + description: 'Compute the hyperbolic cosine of x in radians.', + examples: [ 'cosh(0.5)' ], - 'seealso': [ + seealso: [ 'sinh', 'tanh', 'coth' diff --git a/src/expression/embeddedDocs/function/trigonometry/cot.js b/src/expression/embeddedDocs/function/trigonometry/cot.js index 843e0fb27..144c14665 100644 --- a/src/expression/embeddedDocs/function/trigonometry/cot.js +++ b/src/expression/embeddedDocs/function/trigonometry/cot.js @@ -1,15 +1,15 @@ export const cotDocs = { - 'name': 'cot', - 'category': 'Trigonometry', - 'syntax': [ + name: 'cot', + category: 'Trigonometry', + syntax: [ 'cot(x)' ], - 'description': 'Compute the cotangent of x in radians. Defined as 1/tan(x)', - 'examples': [ + description: 'Compute the cotangent of x in radians. Defined as 1/tan(x)', + examples: [ 'cot(2)', '1 / tan(2)' ], - 'seealso': [ + seealso: [ 'sec', 'csc', 'tan' diff --git a/src/expression/embeddedDocs/function/trigonometry/coth.js b/src/expression/embeddedDocs/function/trigonometry/coth.js index 0fe391b8f..aa3c442d1 100644 --- a/src/expression/embeddedDocs/function/trigonometry/coth.js +++ b/src/expression/embeddedDocs/function/trigonometry/coth.js @@ -1,15 +1,15 @@ export const cothDocs = { - 'name': 'coth', - 'category': 'Trigonometry', - 'syntax': [ + name: 'coth', + category: 'Trigonometry', + syntax: [ 'coth(x)' ], - 'description': 'Compute the hyperbolic cotangent of x in radians.', - 'examples': [ + description: 'Compute the hyperbolic cotangent of x in radians.', + examples: [ 'coth(2)', '1 / tanh(2)' ], - 'seealso': [ + seealso: [ 'sech', 'csch', 'tanh' diff --git a/src/expression/embeddedDocs/function/trigonometry/csc.js b/src/expression/embeddedDocs/function/trigonometry/csc.js index 4a65422b5..d4f3d1f9c 100644 --- a/src/expression/embeddedDocs/function/trigonometry/csc.js +++ b/src/expression/embeddedDocs/function/trigonometry/csc.js @@ -1,15 +1,15 @@ export const cscDocs = { - 'name': 'csc', - 'category': 'Trigonometry', - 'syntax': [ + name: 'csc', + category: 'Trigonometry', + syntax: [ 'csc(x)' ], - 'description': 'Compute the cosecant of x in radians. Defined as 1/sin(x)', - 'examples': [ + description: 'Compute the cosecant of x in radians. Defined as 1/sin(x)', + examples: [ 'csc(2)', '1 / sin(2)' ], - 'seealso': [ + seealso: [ 'sec', 'cot', 'sin' diff --git a/src/expression/embeddedDocs/function/trigonometry/csch.js b/src/expression/embeddedDocs/function/trigonometry/csch.js index 7f1ce5084..e19d49840 100644 --- a/src/expression/embeddedDocs/function/trigonometry/csch.js +++ b/src/expression/embeddedDocs/function/trigonometry/csch.js @@ -1,15 +1,15 @@ export const cschDocs = { - 'name': 'csch', - 'category': 'Trigonometry', - 'syntax': [ + name: 'csch', + category: 'Trigonometry', + syntax: [ 'csch(x)' ], - 'description': 'Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)', - 'examples': [ + description: 'Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)', + examples: [ 'csch(2)', '1 / sinh(2)' ], - 'seealso': [ + seealso: [ 'sech', 'coth', 'sinh' diff --git a/src/expression/embeddedDocs/function/trigonometry/sec.js b/src/expression/embeddedDocs/function/trigonometry/sec.js index 160bb7678..d8d716e3a 100644 --- a/src/expression/embeddedDocs/function/trigonometry/sec.js +++ b/src/expression/embeddedDocs/function/trigonometry/sec.js @@ -1,15 +1,15 @@ export const secDocs = { - 'name': 'sec', - 'category': 'Trigonometry', - 'syntax': [ + name: 'sec', + category: 'Trigonometry', + syntax: [ 'sec(x)' ], - 'description': 'Compute the secant of x in radians. Defined as 1/cos(x)', - 'examples': [ + description: 'Compute the secant of x in radians. Defined as 1/cos(x)', + examples: [ 'sec(2)', '1 / cos(2)' ], - 'seealso': [ + seealso: [ 'cot', 'csc', 'cos' diff --git a/src/expression/embeddedDocs/function/trigonometry/sech.js b/src/expression/embeddedDocs/function/trigonometry/sech.js index bc49306f1..355f6b8c7 100644 --- a/src/expression/embeddedDocs/function/trigonometry/sech.js +++ b/src/expression/embeddedDocs/function/trigonometry/sech.js @@ -1,15 +1,15 @@ export const sechDocs = { - 'name': 'sech', - 'category': 'Trigonometry', - 'syntax': [ + name: 'sech', + category: 'Trigonometry', + syntax: [ 'sech(x)' ], - 'description': 'Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)', - 'examples': [ + description: 'Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)', + examples: [ 'sech(2)', '1 / cosh(2)' ], - 'seealso': [ + seealso: [ 'coth', 'csch', 'cosh' diff --git a/src/expression/embeddedDocs/function/trigonometry/sin.js b/src/expression/embeddedDocs/function/trigonometry/sin.js index 388f915ec..af6fa9f4f 100644 --- a/src/expression/embeddedDocs/function/trigonometry/sin.js +++ b/src/expression/embeddedDocs/function/trigonometry/sin.js @@ -1,18 +1,18 @@ export const sinDocs = { - 'name': 'sin', - 'category': 'Trigonometry', - 'syntax': [ + name: 'sin', + category: 'Trigonometry', + syntax: [ 'sin(x)' ], - 'description': 'Compute the sine of x in radians.', - 'examples': [ + description: 'Compute the sine of x in radians.', + examples: [ 'sin(2)', 'sin(pi / 4) ^ 2', 'sin(90 deg)', 'sin(30 deg)', 'sin(0.2)^2 + cos(0.2)^2' ], - 'seealso': [ + seealso: [ 'asin', 'cos', 'tan' diff --git a/src/expression/embeddedDocs/function/trigonometry/sinh.js b/src/expression/embeddedDocs/function/trigonometry/sinh.js index be04ee471..304ebb742 100644 --- a/src/expression/embeddedDocs/function/trigonometry/sinh.js +++ b/src/expression/embeddedDocs/function/trigonometry/sinh.js @@ -1,14 +1,14 @@ export const sinhDocs = { - 'name': 'sinh', - 'category': 'Trigonometry', - 'syntax': [ + name: 'sinh', + category: 'Trigonometry', + syntax: [ 'sinh(x)' ], - 'description': 'Compute the hyperbolic sine of x in radians.', - 'examples': [ + description: 'Compute the hyperbolic sine of x in radians.', + examples: [ 'sinh(0.5)' ], - 'seealso': [ + seealso: [ 'cosh', 'tanh' ] diff --git a/src/expression/embeddedDocs/function/trigonometry/tan.js b/src/expression/embeddedDocs/function/trigonometry/tan.js index bfb5a0e69..b96109352 100644 --- a/src/expression/embeddedDocs/function/trigonometry/tan.js +++ b/src/expression/embeddedDocs/function/trigonometry/tan.js @@ -1,17 +1,17 @@ export const tanDocs = { - 'name': 'tan', - 'category': 'Trigonometry', - 'syntax': [ + name: 'tan', + category: 'Trigonometry', + syntax: [ 'tan(x)' ], - 'description': 'Compute the tangent of x in radians.', - 'examples': [ + description: 'Compute the tangent of x in radians.', + examples: [ 'tan(0.5)', 'sin(0.5) / cos(0.5)', 'tan(pi / 4)', 'tan(45 deg)' ], - 'seealso': [ + seealso: [ 'atan', 'sin', 'cos' diff --git a/src/expression/embeddedDocs/function/trigonometry/tanh.js b/src/expression/embeddedDocs/function/trigonometry/tanh.js index 6dd8e4e78..1ae0d9070 100644 --- a/src/expression/embeddedDocs/function/trigonometry/tanh.js +++ b/src/expression/embeddedDocs/function/trigonometry/tanh.js @@ -1,15 +1,15 @@ export const tanhDocs = { - 'name': 'tanh', - 'category': 'Trigonometry', - 'syntax': [ + name: 'tanh', + category: 'Trigonometry', + syntax: [ 'tanh(x)' ], - 'description': 'Compute the hyperbolic tangent of x in radians.', - 'examples': [ + description: 'Compute the hyperbolic tangent of x in radians.', + examples: [ 'tanh(0.5)', 'sinh(0.5) / cosh(0.5)' ], - 'seealso': [ + seealso: [ 'sinh', 'cosh' ] diff --git a/src/expression/embeddedDocs/function/units/to.js b/src/expression/embeddedDocs/function/units/to.js index c9dbf9f0b..bfee2e06b 100644 --- a/src/expression/embeddedDocs/function/units/to.js +++ b/src/expression/embeddedDocs/function/units/to.js @@ -1,15 +1,15 @@ export const toDocs = { - 'name': 'to', - 'category': 'Units', - 'syntax': [ + name: 'to', + category: 'Units', + syntax: [ 'x to unit', 'to(x, unit)' ], - 'description': 'Change the unit of a value.', - 'examples': [ + description: 'Change the unit of a value.', + examples: [ '5 inch to cm', '3.2kg to g', '16 bytes in bits' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/function/utils/clone.js b/src/expression/embeddedDocs/function/utils/clone.js index 02380770c..fb40d77a9 100644 --- a/src/expression/embeddedDocs/function/utils/clone.js +++ b/src/expression/embeddedDocs/function/utils/clone.js @@ -1,16 +1,16 @@ export const cloneDocs = { - 'name': 'clone', - 'category': 'Utils', - 'syntax': [ + name: 'clone', + category: 'Utils', + syntax: [ 'clone(x)' ], - 'description': 'Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices', - 'examples': [ + description: 'Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices', + examples: [ 'clone(3.5)', 'clone(2 - 4i)', 'clone(45 deg)', 'clone([1, 2; 3, 4])', 'clone("hello world")' ], - 'seealso': [] + seealso: [] } diff --git a/src/expression/embeddedDocs/function/utils/format.js b/src/expression/embeddedDocs/function/utils/format.js index 76b948489..bcf8e3c5c 100644 --- a/src/expression/embeddedDocs/function/utils/format.js +++ b/src/expression/embeddedDocs/function/utils/format.js @@ -1,16 +1,16 @@ export const formatDocs = { - 'name': 'format', - 'category': 'Utils', - 'syntax': [ + name: 'format', + category: 'Utils', + syntax: [ 'format(value)', 'format(value, precision)' ], - 'description': 'Format a value of any type as string.', - 'examples': [ + description: 'Format a value of any type as string.', + examples: [ 'format(2.3)', 'format(3 - 4i)', 'format([])', 'format(pi, 3)' ], - 'seealso': ['print'] + seealso: ['print'] } diff --git a/src/expression/embeddedDocs/function/utils/hasNumericValue.js b/src/expression/embeddedDocs/function/utils/hasNumericValue.js index 0294de8d0..77dba671e 100644 --- a/src/expression/embeddedDocs/function/utils/hasNumericValue.js +++ b/src/expression/embeddedDocs/function/utils/hasNumericValue.js @@ -1,12 +1,12 @@ export const hasNumericValueDocs = { - 'name': 'hasNumericValue', - 'category': 'Utils', - 'syntax': [ + name: 'hasNumericValue', + category: 'Utils', + syntax: [ 'hasNumericValue(x)' ], - 'description': 'Test whether a value is an numeric value. ' + + description: 'Test whether a value is an numeric value. ' + 'In case of a string, true is returned if the string contains a numeric value.', - 'examples': [ + examples: [ 'hasNumericValue(2)', 'hasNumericValue("2")', 'isNumeric("2")', @@ -16,5 +16,5 @@ export const hasNumericValueDocs = { 'hasNumericValue(2 + 3i)', 'hasNumericValue([2.3, "foo", false])' ], - 'seealso': ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'isNumeric'] + seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'isNumeric'] } diff --git a/src/expression/embeddedDocs/function/utils/isInteger.js b/src/expression/embeddedDocs/function/utils/isInteger.js index e545f4414..479aa9d9f 100644 --- a/src/expression/embeddedDocs/function/utils/isInteger.js +++ b/src/expression/embeddedDocs/function/utils/isInteger.js @@ -1,14 +1,14 @@ export const isIntegerDocs = { - 'name': 'isInteger', - 'category': 'Utils', - 'syntax': [ + name: 'isInteger', + category: 'Utils', + syntax: [ 'isInteger(x)' ], - 'description': 'Test whether a value is an integer number.', - 'examples': [ + description: 'Test whether a value is an integer number.', + examples: [ 'isInteger(2)', 'isInteger(3.5)', 'isInteger([3, 0.5, -2])' ], - 'seealso': ['isNegative', 'isNumeric', 'isPositive', 'isZero'] + seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero'] } diff --git a/src/expression/embeddedDocs/function/utils/isNaN.js b/src/expression/embeddedDocs/function/utils/isNaN.js index aef4aeb20..fdd600cf7 100644 --- a/src/expression/embeddedDocs/function/utils/isNaN.js +++ b/src/expression/embeddedDocs/function/utils/isNaN.js @@ -1,15 +1,15 @@ export const isNaNDocs = { - 'name': 'isNaN', - 'category': 'Utils', - 'syntax': [ + name: 'isNaN', + category: 'Utils', + syntax: [ 'isNaN(x)' ], - 'description': 'Test whether a value is NaN (not a number)', - 'examples': [ + description: 'Test whether a value is NaN (not a number)', + examples: [ 'isNaN(2)', 'isNaN(0 / 0)', 'isNaN(NaN)', 'isNaN(Infinity)' ], - 'seealso': ['isNegative', 'isNumeric', 'isPositive', 'isZero'] + seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero'] } diff --git a/src/expression/embeddedDocs/function/utils/isNegative.js b/src/expression/embeddedDocs/function/utils/isNegative.js index 847f2eb39..01bb012d6 100644 --- a/src/expression/embeddedDocs/function/utils/isNegative.js +++ b/src/expression/embeddedDocs/function/utils/isNegative.js @@ -1,15 +1,15 @@ export const isNegativeDocs = { - 'name': 'isNegative', - 'category': 'Utils', - 'syntax': [ + name: 'isNegative', + category: 'Utils', + syntax: [ 'isNegative(x)' ], - 'description': 'Test whether a value is negative: smaller than zero.', - 'examples': [ + description: 'Test whether a value is negative: smaller than zero.', + examples: [ 'isNegative(2)', 'isNegative(0)', 'isNegative(-4)', 'isNegative([3, 0.5, -2])' ], - 'seealso': ['isInteger', 'isNumeric', 'isPositive', 'isZero'] + seealso: ['isInteger', 'isNumeric', 'isPositive', 'isZero'] } diff --git a/src/expression/embeddedDocs/function/utils/isNumeric.js b/src/expression/embeddedDocs/function/utils/isNumeric.js index a12bb3eb2..4411f73db 100644 --- a/src/expression/embeddedDocs/function/utils/isNumeric.js +++ b/src/expression/embeddedDocs/function/utils/isNumeric.js @@ -1,12 +1,12 @@ export const isNumericDocs = { - 'name': 'isNumeric', - 'category': 'Utils', - 'syntax': [ + name: 'isNumeric', + category: 'Utils', + syntax: [ 'isNumeric(x)' ], - 'description': 'Test whether a value is a numeric value. ' + + description: 'Test whether a value is a numeric value. ' + 'Returns true when the input is a number, BigNumber, Fraction, or boolean.', - 'examples': [ + examples: [ 'isNumeric(2)', 'isNumeric("2")', 'hasNumericValue("2")', @@ -16,5 +16,5 @@ export const isNumericDocs = { 'isNumeric(2 + 3i)', 'isNumeric([2.3, "foo", false])' ], - 'seealso': ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'hasNumericValue'] + seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'hasNumericValue'] } diff --git a/src/expression/embeddedDocs/function/utils/isPositive.js b/src/expression/embeddedDocs/function/utils/isPositive.js index 26e74d792..2e091ed35 100644 --- a/src/expression/embeddedDocs/function/utils/isPositive.js +++ b/src/expression/embeddedDocs/function/utils/isPositive.js @@ -1,15 +1,15 @@ export const isPositiveDocs = { - 'name': 'isPositive', - 'category': 'Utils', - 'syntax': [ + name: 'isPositive', + category: 'Utils', + syntax: [ 'isPositive(x)' ], - 'description': 'Test whether a value is positive: larger than zero.', - 'examples': [ + description: 'Test whether a value is positive: larger than zero.', + examples: [ 'isPositive(2)', 'isPositive(0)', 'isPositive(-4)', 'isPositive([3, 0.5, -2])' ], - 'seealso': ['isInteger', 'isNumeric', 'isNegative', 'isZero'] + seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero'] } diff --git a/src/expression/embeddedDocs/function/utils/isPrime.js b/src/expression/embeddedDocs/function/utils/isPrime.js index 080deb265..f3b2d93ec 100644 --- a/src/expression/embeddedDocs/function/utils/isPrime.js +++ b/src/expression/embeddedDocs/function/utils/isPrime.js @@ -1,14 +1,14 @@ export const isPrimeDocs = { - 'name': 'isPrime', - 'category': 'Utils', - 'syntax': [ + name: 'isPrime', + category: 'Utils', + syntax: [ 'isPrime(x)' ], - 'description': 'Test whether a value is prime: has no divisors other than itself and one.', - 'examples': [ + description: 'Test whether a value is prime: has no divisors other than itself and one.', + examples: [ 'isPrime(3)', 'isPrime(-2)', 'isPrime([2, 17, 100])' ], - 'seealso': ['isInteger', 'isNumeric', 'isNegative', 'isZero'] + seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero'] } diff --git a/src/expression/embeddedDocs/function/utils/isZero.js b/src/expression/embeddedDocs/function/utils/isZero.js index 074714273..cf04f3386 100644 --- a/src/expression/embeddedDocs/function/utils/isZero.js +++ b/src/expression/embeddedDocs/function/utils/isZero.js @@ -1,15 +1,15 @@ export const isZeroDocs = { - 'name': 'isZero', - 'category': 'Utils', - 'syntax': [ + name: 'isZero', + category: 'Utils', + syntax: [ 'isZero(x)' ], - 'description': 'Test whether a value is zero.', - 'examples': [ + description: 'Test whether a value is zero.', + examples: [ 'isZero(2)', 'isZero(0)', 'isZero(-4)', 'isZero([3, 0, -2, 0])' ], - 'seealso': ['isInteger', 'isNumeric', 'isNegative', 'isPositive'] + seealso: ['isInteger', 'isNumeric', 'isNegative', 'isPositive'] } diff --git a/src/expression/embeddedDocs/function/utils/numeric.js b/src/expression/embeddedDocs/function/utils/numeric.js index f888bc1ca..ee2f81590 100644 --- a/src/expression/embeddedDocs/function/utils/numeric.js +++ b/src/expression/embeddedDocs/function/utils/numeric.js @@ -1,11 +1,11 @@ export const numericDocs = { - 'name': 'numeric', - 'category': 'Utils', - 'syntax': [ + name: 'numeric', + category: 'Utils', + syntax: [ 'numeric(x)' ], - 'description': 'Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.', - 'examples': [ + description: 'Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.', + examples: [ 'numeric("4")', 'numeric("4", "number")', 'numeric("4", "BigNumber")', @@ -13,5 +13,5 @@ export const numericDocs = { 'numeric(4, "Fraction")', 'numeric(fraction(2, 5), "number)' ], - 'seealso': ['number', 'fraction', 'bignumber', 'string', 'format'] + seealso: ['number', 'fraction', 'bignumber', 'string', 'format'] } diff --git a/src/expression/embeddedDocs/function/utils/print.js b/src/expression/embeddedDocs/function/utils/print.js index 9099d6f22..466026e57 100644 --- a/src/expression/embeddedDocs/function/utils/print.js +++ b/src/expression/embeddedDocs/function/utils/print.js @@ -1,16 +1,16 @@ export const printDocs = { - 'name': 'print', - 'category': 'Utils', - 'syntax': [ + name: 'print', + category: 'Utils', + syntax: [ 'print(template, values)', 'print(template, values, precision)' ], - 'description': 'Interpolate values into a string template.', - 'examples': [ + description: 'Interpolate values into a string template.', + examples: [ 'print("Lucy is $age years old", {age: 5})', 'print("The value of pi is $pi", {pi: pi}, 3)', 'print("Hello, $user.name!", {user: {name: "John"}})', 'print("Values: $0, $1, $2", [6, 9, 4])' ], - 'seealso': ['format'] + seealso: ['format'] } diff --git a/src/expression/embeddedDocs/function/utils/typeOf.js b/src/expression/embeddedDocs/function/utils/typeOf.js index 23e193649..90995c196 100644 --- a/src/expression/embeddedDocs/function/utils/typeOf.js +++ b/src/expression/embeddedDocs/function/utils/typeOf.js @@ -1,15 +1,15 @@ export const typeOfDocs = { - 'name': 'typeOf', - 'category': 'Utils', - 'syntax': [ + name: 'typeOf', + category: 'Utils', + syntax: [ 'typeOf(x)' ], - 'description': 'Get the type of a variable.', - 'examples': [ + description: 'Get the type of a variable.', + examples: [ 'typeOf(3.5)', 'typeOf(2 - 4i)', 'typeOf(45 deg)', 'typeOf("hello world")' ], - 'seealso': ['getMatrixDataType'] + seealso: ['getMatrixDataType'] } diff --git a/src/expression/function/compile.js b/src/expression/function/compile.js index 73b402962..9a8ec4a71 100644 --- a/src/expression/function/compile.js +++ b/src/expression/function/compile.js @@ -40,7 +40,7 @@ export const createCompile = /* #__PURE__ */ factory(name, dependencies, ({ type * @throws {Error} */ return typed(name, { - 'string': function (expr) { + string: function (expr) { return parse(expr).compile() }, diff --git a/src/expression/function/evaluate.js b/src/expression/function/evaluate.js index de344dcde..7ad053c19 100644 --- a/src/expression/function/evaluate.js +++ b/src/expression/function/evaluate.js @@ -38,8 +38,8 @@ export const createEvaluate = /* #__PURE__ */ factory(name, dependencies, ({ typ * @throws {Error} */ return typed(name, { - 'string': function (expr) { - let scope = {} + string: function (expr) { + const scope = {} return parse(expr).compile().evaluate(scope) }, @@ -48,7 +48,7 @@ export const createEvaluate = /* #__PURE__ */ factory(name, dependencies, ({ typ }, 'Array | Matrix': function (expr) { - let scope = {} + const scope = {} return deepMap(expr, function (entry) { return parse(entry).compile().evaluate(scope) }) diff --git a/src/expression/function/help.js b/src/expression/function/help.js index 7905906c4..e82c7bc97 100644 --- a/src/expression/function/help.js +++ b/src/expression/function/help.js @@ -1,6 +1,7 @@ import { factory } from '../../utils/factory' import { getSafeProperty } from '../../utils/customs' import { embeddedDocs } from '../embeddedDocs/embeddedDocs' +import { hasOwnProperty } from '../../utils/object' const name = 'help' const dependencies = ['typed', 'mathWithTransform', 'Help'] @@ -25,14 +26,14 @@ export const createHelp = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {Help} A help object */ return typed(name, { - 'any': function (search) { + any: function (search) { let prop let searchName = search if (typeof search !== 'string') { for (prop in mathWithTransform) { // search in functions and constants - if (mathWithTransform.hasOwnProperty(prop) && (search === mathWithTransform[prop])) { + if (hasOwnProperty(mathWithTransform, prop) && (search === mathWithTransform[prop])) { searchName = prop break } @@ -42,7 +43,7 @@ export const createHelp = /* #__PURE__ */ factory(name, dependencies, ({ typed, if (!text) { // search data type for (prop in math.type) { - if (math.hasOwnProperty(prop)) { + if (hasOwnProperty(math, prop)) { if (search === math.type[prop]) { text = prop break diff --git a/src/expression/node/ObjectNode.js b/src/expression/node/ObjectNode.js index d7cef1837..fcec7663d 100644 --- a/src/expression/node/ObjectNode.js +++ b/src/expression/node/ObjectNode.js @@ -88,7 +88,7 @@ export const createObjectNode = /* #__PURE__ */ factory(name, dependencies, ({ N */ ObjectNode.prototype.forEach = function (callback) { for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { + if (hasOwnProperty(this.properties, key)) { callback(this.properties[key], 'properties[' + stringify(key) + ']', this) } } @@ -103,7 +103,7 @@ export const createObjectNode = /* #__PURE__ */ factory(name, dependencies, ({ N ObjectNode.prototype.map = function (callback) { const properties = {} for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { + if (hasOwnProperty(this.properties, key)) { properties[key] = this._ifNode(callback(this.properties[key], 'properties[' + stringify(key) + ']', this)) } @@ -118,7 +118,7 @@ export const createObjectNode = /* #__PURE__ */ factory(name, dependencies, ({ N ObjectNode.prototype.clone = function () { const properties = {} for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { + if (hasOwnProperty(this.properties, key)) { properties[key] = this.properties[key] } } @@ -134,7 +134,7 @@ export const createObjectNode = /* #__PURE__ */ factory(name, dependencies, ({ N ObjectNode.prototype._toString = function (options) { const entries = [] for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { + if (hasOwnProperty(this.properties, key)) { entries.push(stringify(key) + ': ' + this.properties[key].toString(options)) } } @@ -172,7 +172,7 @@ export const createObjectNode = /* #__PURE__ */ factory(name, dependencies, ({ N ObjectNode.prototype.toHTML = function (options) { const entries = [] for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { + if (hasOwnProperty(this.properties, key)) { entries.push('' + escape(key) + '' + ':' + this.properties[key].toHTML(options)) } } @@ -187,7 +187,7 @@ export const createObjectNode = /* #__PURE__ */ factory(name, dependencies, ({ N ObjectNode.prototype._toTex = function (options) { const entries = [] for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { + if (hasOwnProperty(this.properties, key)) { entries.push('\\mathbf{' + key + ':} & ' + this.properties[key].toTex(options) + '\\\\') } } diff --git a/src/expression/node/RelationalNode.js b/src/expression/node/RelationalNode.js index 898e57897..ad68647b3 100644 --- a/src/expression/node/RelationalNode.js +++ b/src/expression/node/RelationalNode.js @@ -114,12 +114,12 @@ export const createRelationalNode = /* #__PURE__ */ factory(name, dependencies, }) const operatorMap = { - 'equal': '==', - 'unequal': '!=', - 'smaller': '<', - 'larger': '>', - 'smallerEq': '<=', - 'largerEq': '>=' + equal: '==', + unequal: '!=', + smaller: '<', + larger: '>', + smallerEq: '<=', + largerEq: '>=' } let ret = paramStrings[0] @@ -170,12 +170,12 @@ export const createRelationalNode = /* #__PURE__ */ factory(name, dependencies, }) const operatorMap = { - 'equal': '==', - 'unequal': '!=', - 'smaller': '<', - 'larger': '>', - 'smallerEq': '<=', - 'largerEq': '>=' + equal: '==', + unequal: '!=', + smaller: '<', + larger: '>', + smallerEq: '<=', + largerEq: '>=' } let ret = paramStrings[0] diff --git a/src/expression/operators.js b/src/expression/operators.js index e34122e9e..547abe8aa 100644 --- a/src/expression/operators.js +++ b/src/expression/operators.js @@ -16,13 +16,15 @@ // left argument doesn't need to be enclosed // in parentheses // latexRightParens: the same for the right argument +import { hasOwnProperty } from '../utils/object' + export const properties = [ { // assignment - 'AssignmentNode': {}, - 'FunctionAssignmentNode': {} + AssignmentNode: {}, + FunctionAssignmentNode: {} }, { // conditional expression - 'ConditionalNode': { + ConditionalNode: { latexLeftParens: false, latexRightParens: false, latexParens: false @@ -92,7 +94,7 @@ export const properties = [ associativity: 'left', associativeWith: [] }, - 'RelationalNode': { + RelationalNode: { associativity: 'left', associativeWith: [] } @@ -118,7 +120,7 @@ export const properties = [ } }, { // range - 'RangeNode': {} + RangeNode: {} }, { // addition, subtraction 'OperatorNode:add': { @@ -213,9 +215,9 @@ export const properties = [ * Higher number for higher precedence, starting with 0. * Returns null if the precedence is undefined. * - * @param {Node} + * @param {Node} _node * @param {string} parenthesis - * @return {number|null} + * @return {number | null} */ export function getPrecedence (_node, parenthesis) { let node = _node @@ -256,7 +258,7 @@ export function getAssociativity (_node, parenthesis) { } const property = properties[index][identifier] - if (property.hasOwnProperty('associativity')) { + if (hasOwnProperty(property, 'associativity')) { if (property.associativity === 'left') { return 'left' } @@ -279,7 +281,7 @@ export function getAssociativity (_node, parenthesis) { * @param {Node} nodeA * @param {Node} nodeB * @param {string} parenthesis - * @return {bool|null} + * @return {boolean | null} */ export function isAssociativeWith (nodeA, nodeB, parenthesis) { // ParenthesisNodes are only ignored when not in 'keep' mode @@ -294,7 +296,7 @@ export function isAssociativeWith (nodeA, nodeB, parenthesis) { } const property = properties[index][identifierA] - if (property.hasOwnProperty('associativeWith') && + if (hasOwnProperty(property, 'associativeWith') && (property.associativeWith instanceof Array)) { for (let i = 0; i < property.associativeWith.length; i++) { if (property.associativeWith[i] === identifierB) { diff --git a/src/expression/parse.js b/src/expression/parse.js index 2f323737c..45a2eabbe 100644 --- a/src/expression/parse.js +++ b/src/expression/parse.js @@ -1,6 +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' const name = 'parse' const dependencies = [ @@ -84,7 +85,7 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ * @throws {Error} */ const parse = typed(name, { - 'string': function (expression) { + string: function (expression) { return parseStart(expression, {}) }, 'Array | Matrix': function (expressions) { @@ -163,20 +164,20 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ // map with all named delimiters const NAMED_DELIMITERS = { - 'mod': true, - 'to': true, - 'in': true, - 'and': true, - 'xor': true, - 'or': true, - 'not': true + mod: true, + to: true, + in: true, + and: true, + xor: true, + or: true, + not: true } const CONSTANTS = { - 'true': true, - 'false': false, - 'null': null, - 'undefined': undefined + true: true, + false: false, + null: null, + undefined: undefined } const NUMERIC_CONSTANTS = [ @@ -200,7 +201,7 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ /** * View upto `length` characters of the expression starting at the current character. * - * @param {State} state + * @param {Object} state * @param {number} [length=1] Number of characters to view * @returns {string} * @private @@ -212,7 +213,7 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ /** * View the current character. Returns '' if end of expression is reached. * - * @param {State} state + * @param {Object} state * @returns {string} * @private */ @@ -383,7 +384,7 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ next(state) } - if (NAMED_DELIMITERS.hasOwnProperty(state.token)) { + if (hasOwnProperty(NAMED_DELIMITERS, state.token)) { state.tokenType = TOKENTYPE.DELIMITER } else { state.tokenType = TOKENTYPE.SYMBOL @@ -805,7 +806,7 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ '>=': 'largerEq' } - while (operators.hasOwnProperty(state.token)) { // eslint-disable-line no-unmodified-loop-condition + while (hasOwnProperty(operators, state.token)) { // eslint-disable-line no-unmodified-loop-condition const cond = { name: state.token, fn: operators[state.token] } conditionals.push(cond) getTokenSkipNewline(state) @@ -827,17 +828,17 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ * @private */ function parseShift (state) { - let node, operators, name, fn, params + let node, name, fn, params node = parseConversion(state) - operators = { + const operators = { '<<': 'leftShift', '>>': 'rightArithShift', '>>>': 'rightLogShift' } - while (operators.hasOwnProperty(state.token)) { + while (hasOwnProperty(operators, state.token)) { name = state.token fn = operators[name] @@ -855,16 +856,16 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ * @private */ function parseConversion (state) { - let node, operators, name, fn, params + let node, name, fn, params node = parseRange(state) - operators = { - 'to': 'to', - 'in': 'to' // alias of 'to' + const operators = { + to: 'to', + in: 'to' // alias of 'to' } - while (operators.hasOwnProperty(state.token)) { + while (hasOwnProperty(operators, state.token)) { name = state.token fn = operators[name] @@ -935,15 +936,15 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ * @private */ function parseAddSubtract (state) { - let node, operators, name, fn, params + let node, name, fn, params node = parseMultiplyDivide(state) - operators = { + const operators = { '+': 'add', '-': 'subtract' } - while (operators.hasOwnProperty(state.token)) { + while (hasOwnProperty(operators, state.token)) { name = state.token fn = operators[name] @@ -961,22 +962,22 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ * @private */ function parseMultiplyDivide (state) { - let node, last, operators, name, fn + let node, last, name, fn node = parseImplicitMultiplication(state) last = node - operators = { + const operators = { '*': 'multiply', '.*': 'dotMultiply', '/': 'divide', './': 'dotDivide', '%': 'mod', - 'mod': 'mod' + mod: 'mod' } while (true) { - if (operators.hasOwnProperty(state.token)) { + if (hasOwnProperty(operators, state.token)) { // explicit operators name = state.token fn = operators[name] @@ -1036,7 +1037,7 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ function parseRule2 (state) { let node = parseUnary(state) let last = node - let tokenStates = [] + const tokenStates = [] while (true) { // Match the "number /" part of the pattern "number / number symbol" @@ -1089,10 +1090,10 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ '-': 'unaryMinus', '+': 'unaryPlus', '~': 'bitNot', - 'not': 'not' + not: 'not' } - if (operators.hasOwnProperty(state.token)) { + if (hasOwnProperty(operators, state.token)) { fn = operators[state.token] name = state.token @@ -1134,16 +1135,16 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ * @private */ function parseLeftHandOperators (state) { - let node, operators, name, fn, params + let node, name, fn, params node = parseCustomNodes(state) - operators = { + const operators = { '!': 'factorial', '\'': 'ctranspose' } - while (operators.hasOwnProperty(state.token)) { + while (hasOwnProperty(operators, state.token)) { name = state.token fn = operators[name] @@ -1188,7 +1189,7 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ function parseCustomNodes (state) { let params = [] - if (state.tokenType === TOKENTYPE.SYMBOL && state.extraNodes.hasOwnProperty(state.token)) { + if (state.tokenType === TOKENTYPE.SYMBOL && hasOwnProperty(state.extraNodes, state.token)) { const CustomNode = state.extraNodes[state.token] getToken(state) @@ -1239,7 +1240,7 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ getToken(state) - if (CONSTANTS.hasOwnProperty(name)) { // true, false, null, ... + if (hasOwnProperty(CONSTANTS, name)) { // true, false, null, ... node = new ConstantNode(CONSTANTS[name]) } else if (NUMERIC_CONSTANTS.indexOf(name) !== -1) { // NaN, Infinity node = new ConstantNode(numeric(name, 'number')) @@ -1260,6 +1261,7 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ * - function invocation in round brackets (...), for example sqrt(2) * - index enclosed in square brackets [...], for example A[2,3] * - dot notation for properties, like foo.bar + * @param {Object} state * @param {Node} node Node on which to apply the parameters. If there * are no parameters in the expression, the node * itself is returned @@ -1675,6 +1677,7 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ /** * Create an error + * @param {Object} state * @param {string} message * @return {SyntaxError} instantiated error * @private @@ -1689,6 +1692,7 @@ export const createParse = /* #__PURE__ */ factory(name, dependencies, ({ /** * Create an error + * @param {Object} state * @param {string} message * @return {Error} instantiated error * @private diff --git a/src/function/algebra/decomposition/lup.js b/src/function/algebra/decomposition/lup.js index e4affc93c..abfc5f941 100644 --- a/src/function/algebra/decomposition/lup.js +++ b/src/function/algebra/decomposition/lup.js @@ -63,15 +63,15 @@ export const createLup = /* #__PURE__ */ factory(name, dependencies, ( */ return typed(name, { - 'DenseMatrix': function (m) { + DenseMatrix: function (m) { return _denseLUP(m) }, - 'SparseMatrix': function (m) { + SparseMatrix: function (m) { return _sparseLUP(m) }, - 'Array': function (a) { + Array: function (a) { // create dense matrix from array const m = matrix(a) // lup, use matrix implementation diff --git a/src/function/algebra/decomposition/qr.js b/src/function/algebra/decomposition/qr.js index 8aff761f0..5e4f9ff95 100644 --- a/src/function/algebra/decomposition/qr.js +++ b/src/function/algebra/decomposition/qr.js @@ -81,15 +81,15 @@ export const createQr = /* #__PURE__ */ factory(name, dependencies, ( */ return typed(name, { - 'DenseMatrix': function (m) { + DenseMatrix: function (m) { return _denseQR(m) }, - 'SparseMatrix': function (m) { + SparseMatrix: function (m) { return _sparseQR(m) }, - 'Array': function (a) { + Array: function (a) { // create dense matrix from array const m = matrix(a) // lup, use matrix implementation diff --git a/src/function/algebra/rationalize.js b/src/function/algebra/rationalize.js index 6466ba6cd..02e2b3784 100644 --- a/src/function/algebra/rationalize.js +++ b/src/function/algebra/rationalize.js @@ -126,7 +126,7 @@ export const createRationalize = /* #__PURE__ */ factory(name, dependencies, ({ * */ const rationalize = typed(name, { - 'string': function (expr) { + string: function (expr) { return rationalize(parse(expr), {}, false) }, @@ -142,7 +142,7 @@ export const createRationalize = /* #__PURE__ */ factory(name, dependencies, ({ return rationalize(parse(expr), scope, detailed) }, - 'Node': function (expr) { + Node: function (expr) { return rationalize(expr, {}, false) }, diff --git a/src/function/algebra/simplify.js b/src/function/algebra/simplify.js index a52924bfb..b78d8ce55 100644 --- a/src/function/algebra/simplify.js +++ b/src/function/algebra/simplify.js @@ -4,6 +4,7 @@ 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' const name = 'simplify' const dependencies = [ @@ -152,7 +153,7 @@ export const createSimplify = /* #__PURE__ */ factory(name, dependencies, ( * @return {Node} Returns the simplified form of `expr` */ const simplify = typed('simplify', { - 'string': function (expr) { + string: function (expr) { return simplify(parse(expr), simplify.rules, {}, {}) }, @@ -184,7 +185,7 @@ export const createSimplify = /* #__PURE__ */ factory(name, dependencies, ( return simplify(expr, simplify.rules, scope, options) }, - 'Node': function (expr) { + Node: function (expr) { return simplify(expr, simplify.rules, {}, {}) }, @@ -200,7 +201,7 @@ export const createSimplify = /* #__PURE__ */ factory(name, dependencies, ( rules = _buildRules(rules) let res = resolve(expr, scope) res = removeParens(res) - let visited = {} + const visited = {} let str = res.toString({ parenthesis: 'all' }) while (!visited[str]) { visited[str] = true @@ -301,8 +302,8 @@ export const createSimplify = /* #__PURE__ */ factory(name, dependencies, ( { l: '(-n)*n1', r: '-(n*n1)' }, // make factors positive (and undo 'make non-constant terms positive') // ordering of constants - { l: 'c+v', r: 'v+c', context: { 'add': { commutative: false } } }, - { l: 'v*c', r: 'c*v', context: { 'multiply': { commutative: false } } }, + { l: 'c+v', r: 'v+c', context: { add: { commutative: false } } }, + { l: 'v*c', r: 'c*v', context: { multiply: { commutative: false } } }, // undo temporary rules // { l: '(-1) * n', r: '-n' }, // #811 added test which proved this is redundant @@ -446,7 +447,7 @@ export const createSimplify = /* #__PURE__ */ factory(name, dependencies, ( // Replace placeholders with their respective nodes without traversing deeper into the replaced nodes res = res.transform(function (node) { - if (node.isSymbolNode && matches.placeholders.hasOwnProperty(node.name)) { + if (node.isSymbolNode && hasOwnProperty(matches.placeholders, node.name)) { return matches.placeholders[node.name].clone() } else { return node @@ -504,16 +505,16 @@ export const createSimplify = /* #__PURE__ */ factory(name, dependencies, ( } // Placeholders with the same key must match exactly - for (let key in match1.placeholders) { + for (const key in match1.placeholders) { res.placeholders[key] = match1.placeholders[key] - if (match2.placeholders.hasOwnProperty(key)) { + if (hasOwnProperty(match2.placeholders, key)) { if (!_exactMatch(match1.placeholders[key], match2.placeholders[key])) { return null } } } - for (let key in match2.placeholders) { + for (const key in match2.placeholders) { res.placeholders[key] = match2.placeholders[key] } diff --git a/src/function/algebra/simplify/simplifyConstant.js b/src/function/algebra/simplify/simplifyConstant.js index 18b48d4fd..dd37da875 100644 --- a/src/function/algebra/simplify/simplifyConstant.js +++ b/src/function/algebra/simplify/simplifyConstant.js @@ -52,20 +52,20 @@ export const createSimplifyConstant = /* #__PURE__ */ factory(name, dependencies } const _toNode = typed({ - 'Fraction': _fractionToNode, - 'number': function (n) { + Fraction: _fractionToNode, + number: function (n) { if (n < 0) { return unaryMinusNode(new ConstantNode(-n)) } return new ConstantNode(n) }, - 'BigNumber': function (n) { + BigNumber: function (n) { if (n < 0) { return unaryMinusNode(new ConstantNode(-n)) } return new ConstantNode(n) // old parameters: (n.toString(), 'number') }, - 'Complex': function (s) { + Complex: function (s) { throw new Error('Cannot convert Complex number to Node') } }) @@ -181,7 +181,7 @@ export const createSimplifyConstant = /* #__PURE__ */ factory(name, dependencies } // Process operators as OperatorNode - const operatorFunctions = [ 'add', 'multiply' ] + const operatorFunctions = ['add', 'multiply'] if (operatorFunctions.indexOf(node.name) === -1) { let args = node.args.map(arg => foldFraction(arg, options)) diff --git a/src/function/algebra/simplify/util.js b/src/function/algebra/simplify/util.js index c77947f76..6a5a8ff4a 100644 --- a/src/function/algebra/simplify/util.js +++ b/src/function/algebra/simplify/util.js @@ -1,5 +1,6 @@ import { isOperatorNode } from '../../../utils/is' import { factory } from '../../../utils/factory' +import { hasOwnProperty } from '../../../utils/object' const name = 'simplifyUtil' const dependencies = [ @@ -14,12 +15,12 @@ export const createUtil = /* #__PURE__ */ factory(name, dependencies, ({ Functio // The properties should be calculated from an argument to simplify, or possibly something in math.config // the other option is for typed() to specify a return type so that we can evaluate the type of arguments const commutative = { - 'add': true, - 'multiply': true + add: true, + multiply: true } const associative = { - 'add': true, - 'multiply': true + add: true, + multiply: true } function isCommutative (node, context) { @@ -27,7 +28,7 @@ export const createUtil = /* #__PURE__ */ factory(name, dependencies, ({ Functio return true } const name = node.fn.toString() - if (context && context.hasOwnProperty(name) && context[name].hasOwnProperty('commutative')) { + if (context && hasOwnProperty(context, name) && hasOwnProperty(context[name], 'commutative')) { return context[name].commutative } return commutative[name] || false @@ -38,7 +39,7 @@ export const createUtil = /* #__PURE__ */ factory(name, dependencies, ({ Functio return false } const name = node.fn.toString() - if (context && context.hasOwnProperty(name) && context[name].hasOwnProperty('associative')) { + if (context && hasOwnProperty(context, name) && hasOwnProperty(context[name], 'associative')) { return context[name].associative } return associative[name] || false diff --git a/src/function/algebra/sparse/csLeaf.js b/src/function/algebra/sparse/csLeaf.js index 2dd9bec87..7d43326cb 100644 --- a/src/function/algebra/sparse/csLeaf.js +++ b/src/function/algebra/sparse/csLeaf.js @@ -15,7 +15,7 @@ * Reference: http://faculty.cse.tamu.edu/davis/publications.html */ export function csLeaf (i, j, w, first, maxfirst, prevleaf, ancestor) { - let s, sparent, jprev + let s, sparent // our result let jleaf = 0 @@ -26,7 +26,7 @@ export function csLeaf (i, j, w, first, maxfirst, prevleaf, ancestor) { // update max first[j] seen so far w[maxfirst + i] = w[first + j] // jprev = previous leaf of ith subtree - jprev = w[prevleaf + i] + const jprev = w[prevleaf + i] w[prevleaf + i] = j // check j is first or subsequent leaf diff --git a/src/function/arithmetic/abs.js b/src/function/arithmetic/abs.js index fd829b1b0..030795d55 100644 --- a/src/function/arithmetic/abs.js +++ b/src/function/arithmetic/abs.js @@ -31,17 +31,17 @@ export const createAbs = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * Absolute value of `x` */ const abs = typed(name, { - 'number': absNumber, + number: absNumber, - 'Complex': function (x) { + Complex: function (x) { return x.abs() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.abs() }, - 'Fraction': function (x) { + Fraction: function (x) { return x.abs() }, @@ -50,7 +50,7 @@ export const createAbs = /* #__PURE__ */ factory(name, dependencies, ({ typed }) return deepMap(x, abs, true) }, - 'Unit': function (x) { + Unit: function (x) { return x.abs() } }) diff --git a/src/function/arithmetic/cbrt.js b/src/function/arithmetic/cbrt.js index d7930ba0f..897c36f7d 100644 --- a/src/function/arithmetic/cbrt.js +++ b/src/function/arithmetic/cbrt.js @@ -56,19 +56,19 @@ export const createCbrt = /* #__PURE__ */ factory(name, dependencies, ({ config, * Returns the cubic root of `x` */ const cbrt = typed(name, { - 'number': cbrtNumber, + number: cbrtNumber, // note: signature 'number, boolean' is also supported, // created by typed as it knows how to convert number to Complex - 'Complex': _cbrtComplex, + Complex: _cbrtComplex, 'Complex, boolean': _cbrtComplex, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.cbrt() }, - 'Unit': _cbrtUnit, + Unit: _cbrtUnit, 'Array | Matrix': function (x) { // deep map collection, skip zeros since cbrt(0) = 0 @@ -136,7 +136,7 @@ export const createCbrt = /* #__PURE__ */ factory(name, dependencies, ({ config, third = 1 / 3 } - let result = x.pow(third) + const result = x.pow(third) if (negate) { result.value = unaryMinus(result.value) diff --git a/src/function/arithmetic/ceil.js b/src/function/arithmetic/ceil.js index fa51d46d7..0d8e7546a 100644 --- a/src/function/arithmetic/ceil.js +++ b/src/function/arithmetic/ceil.js @@ -37,7 +37,7 @@ export const createCeil = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value */ const ceil = typed('ceil', { - 'number': function (x) { + number: function (x) { if (nearlyEqual(x, round(x), config.epsilon)) { return round(x) } else { @@ -45,11 +45,11 @@ export const createCeil = /* #__PURE__ */ factory(name, dependencies, ({ typed, } }, - 'Complex': function (x) { + Complex: function (x) { return x.ceil() }, - 'BigNumber': function (x) { + BigNumber: function (x) { if (bigNearlyEqual(x, round(x), config.epsilon)) { return round(x) } else { @@ -57,7 +57,7 @@ export const createCeil = /* #__PURE__ */ factory(name, dependencies, ({ typed, } }, - 'Fraction': function (x) { + Fraction: function (x) { return x.ceil() }, diff --git a/src/function/arithmetic/cube.js b/src/function/arithmetic/cube.js index 49a6551eb..5f0ef9d79 100644 --- a/src/function/arithmetic/cube.js +++ b/src/function/arithmetic/cube.js @@ -31,17 +31,17 @@ export const createCube = /* #__PURE__ */ factory(name, dependencies, ({ typed } * @return {number | BigNumber | Fraction | Complex | Array | Matrix | Unit} Cube of x */ const cube = typed(name, { - 'number': cubeNumber, + number: cubeNumber, - 'Complex': function (x) { + Complex: function (x) { return x.mul(x).mul(x) // Is faster than pow(x, 3) }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.times(x).times(x) }, - 'Fraction': function (x) { + Fraction: function (x) { return x.pow(3) // Is faster than mul()mul()mul() }, @@ -50,7 +50,7 @@ export const createCube = /* #__PURE__ */ factory(name, dependencies, ({ typed } return deepMap(x, cube, true) }, - 'Unit': function (x) { + Unit: function (x) { return x.pow(3) } }) diff --git a/src/function/arithmetic/exp.js b/src/function/arithmetic/exp.js index e88c23ae6..c8d9f3f7e 100644 --- a/src/function/arithmetic/exp.js +++ b/src/function/arithmetic/exp.js @@ -35,13 +35,13 @@ export const createExp = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @return {number | BigNumber | Complex | Array | Matrix} Exponent of `x` */ const exp = typed(name, { - 'number': expNumber, + number: expNumber, - 'Complex': function (x) { + Complex: function (x) { return x.exp() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.exp() }, diff --git a/src/function/arithmetic/expm1.js b/src/function/arithmetic/expm1.js index 86b9a9ac6..ad9e7bd7d 100644 --- a/src/function/arithmetic/expm1.js +++ b/src/function/arithmetic/expm1.js @@ -3,7 +3,7 @@ import { deepMap } from '../../utils/collection' import { expm1Number } from '../../plain/number' const name = 'expm1' -const dependencies = [ 'typed', 'Complex' ] +const dependencies = ['typed', 'Complex'] export const createExpm1 = /* #__PURE__ */ factory(name, dependencies, ({ typed, Complex }) => { /** @@ -35,9 +35,9 @@ export const createExpm1 = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | BigNumber | Complex | Array | Matrix} Exponent of `x` */ const expm1 = typed(name, { - 'number': expm1Number, + number: expm1Number, - 'Complex': function (x) { + Complex: function (x) { const r = Math.exp(x.re) return new Complex( r * Math.cos(x.im) - 1, @@ -45,7 +45,7 @@ export const createExpm1 = /* #__PURE__ */ factory(name, dependencies, ({ typed, ) }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.exp().minus(1) }, diff --git a/src/function/arithmetic/fix.js b/src/function/arithmetic/fix.js index 7fae24041..8b4d14528 100644 --- a/src/function/arithmetic/fix.js +++ b/src/function/arithmetic/fix.js @@ -33,22 +33,22 @@ export const createFix = /* #__PURE__ */ factory(name, dependencies, ({ typed, C * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value */ const fix = typed('fix', { - 'number': function (x) { + number: function (x) { return (x > 0) ? floor(x) : ceil(x) }, - 'Complex': function (x) { + Complex: function (x) { return new Complex( (x.re > 0) ? Math.floor(x.re) : Math.ceil(x.re), (x.im > 0) ? Math.floor(x.im) : Math.ceil(x.im) ) }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.isNegative() ? ceil(x) : floor(x) }, - 'Fraction': function (x) { + Fraction: function (x) { return x.s < 0 ? x.ceil() : x.floor() }, diff --git a/src/function/arithmetic/floor.js b/src/function/arithmetic/floor.js index ef4e04078..634771418 100644 --- a/src/function/arithmetic/floor.js +++ b/src/function/arithmetic/floor.js @@ -35,7 +35,7 @@ export const createFloor = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value */ const floor = typed('floor', { - 'number': function (x) { + number: function (x) { if (nearlyEqual(x, round(x), config.epsilon)) { return round(x) } else { @@ -43,11 +43,11 @@ export const createFloor = /* #__PURE__ */ factory(name, dependencies, ({ typed, } }, - 'Complex': function (x) { + Complex: function (x) { return x.floor() }, - 'BigNumber': function (x) { + BigNumber: function (x) { if (bigNearlyEqual(x, round(x), config.epsilon)) { return round(x) } else { @@ -55,7 +55,7 @@ export const createFloor = /* #__PURE__ */ factory(name, dependencies, ({ typed, } }, - 'Fraction': function (x) { + Fraction: function (x) { return x.floor() }, diff --git a/src/function/arithmetic/hypot.js b/src/function/arithmetic/hypot.js index 1e79491b1..1e7fc4ce1 100644 --- a/src/function/arithmetic/hypot.js +++ b/src/function/arithmetic/hypot.js @@ -45,11 +45,11 @@ export const createHypot = /* #__PURE__ */ factory(name, dependencies, ({ typed, const hypot = typed(name, { '... number | BigNumber': _hypot, - 'Array': function (x) { + Array: function (x) { return hypot.apply(hypot, flatten(x)) }, - 'Matrix': function (x) { + Matrix: function (x) { return hypot.apply(hypot, flatten(x.toArray())) } }) diff --git a/src/function/arithmetic/log.js b/src/function/arithmetic/log.js index 34b650383..620600ffc 100644 --- a/src/function/arithmetic/log.js +++ b/src/function/arithmetic/log.js @@ -41,7 +41,7 @@ export const createLog = /* #__PURE__ */ factory(name, dependencies, ({ typed, c * Returns the logarithm of `x` */ const log = typed(name, { - 'number': function (x) { + number: function (x) { if (x >= 0 || config.predictable) { return logNumber(x) } else { @@ -50,11 +50,11 @@ export const createLog = /* #__PURE__ */ factory(name, dependencies, ({ typed, c } }, - 'Complex': function (x) { + Complex: function (x) { return x.log() }, - 'BigNumber': function (x) { + BigNumber: function (x) { if (!x.isNegative() || config.predictable) { return x.ln() } else { diff --git a/src/function/arithmetic/log10.js b/src/function/arithmetic/log10.js index f8d5bc90e..6a87dbd5d 100644 --- a/src/function/arithmetic/log10.js +++ b/src/function/arithmetic/log10.js @@ -3,7 +3,7 @@ import { deepMap } from '../../utils/collection' import { log10Number } from '../../plain/number' const name = 'log10' -const dependencies = [ 'typed', 'config', 'Complex' ] +const dependencies = ['typed', 'config', 'Complex'] export const createLog10 = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, Complex }) => { /** @@ -32,7 +32,7 @@ export const createLog10 = /* #__PURE__ */ factory(name, dependencies, ({ typed, * Returns the 10-base logarithm of `x` */ const log10 = typed(name, { - 'number': function (x) { + number: function (x) { if (x >= 0 || config.predictable) { return log10Number(x) } else { @@ -41,11 +41,11 @@ export const createLog10 = /* #__PURE__ */ factory(name, dependencies, ({ typed, } }, - 'Complex': function (x) { + Complex: function (x) { return new Complex(x).log().div(Math.LN10) }, - 'BigNumber': function (x) { + BigNumber: function (x) { if (!x.isNegative() || config.predictable) { return x.log() } else { diff --git a/src/function/arithmetic/log1p.js b/src/function/arithmetic/log1p.js index c98263282..6523221e0 100644 --- a/src/function/arithmetic/log1p.js +++ b/src/function/arithmetic/log1p.js @@ -3,7 +3,7 @@ import { deepMap } from '../../utils/collection' import { log1p as _log1p } from '../../utils/number' const name = 'log1p' -const dependencies = [ 'typed', 'config', 'divideScalar', 'log', 'Complex' ] +const dependencies = ['typed', 'config', 'divideScalar', 'log', 'Complex'] export const createLog1p = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, divideScalar, log, Complex }) => { /** @@ -38,7 +38,7 @@ export const createLog1p = /* #__PURE__ */ factory(name, dependencies, ({ typed, * Returns the logarithm of `x+1` */ const log1p = typed(name, { - 'number': function (x) { + number: function (x) { if (x >= -1 || config.predictable) { return _log1p(x) } else { @@ -47,9 +47,9 @@ export const createLog1p = /* #__PURE__ */ factory(name, dependencies, ({ typed, } }, - 'Complex': _log1pComplex, + Complex: _log1pComplex, - 'BigNumber': function (x) { + BigNumber: function (x) { const y = x.plus(1) if (!y.isNegative() || config.predictable) { return y.ln() diff --git a/src/function/arithmetic/log2.js b/src/function/arithmetic/log2.js index 484c1571a..f30568390 100644 --- a/src/function/arithmetic/log2.js +++ b/src/function/arithmetic/log2.js @@ -3,7 +3,7 @@ import { deepMap } from '../../utils/collection' import { log2Number } from '../../plain/number' const name = 'log2' -const dependencies = [ 'typed', 'config', 'Complex' ] +const dependencies = ['typed', 'config', 'Complex'] export const createLog2 = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, Complex }) => { /** @@ -32,7 +32,7 @@ export const createLog2 = /* #__PURE__ */ factory(name, dependencies, ({ typed, * Returns the 2-base logarithm of `x` */ const log2 = typed(name, { - 'number': function (x) { + number: function (x) { if (x >= 0 || config.predictable) { return log2Number(x) } else { @@ -41,9 +41,9 @@ export const createLog2 = /* #__PURE__ */ factory(name, dependencies, ({ typed, } }, - 'Complex': _log2Complex, + Complex: _log2Complex, - 'BigNumber': function (x) { + BigNumber: function (x) { if (!x.isNegative() || config.predictable) { return x.log(2) } else { diff --git a/src/function/arithmetic/norm.js b/src/function/arithmetic/norm.js index c267002f0..a28e3efbe 100644 --- a/src/function/arithmetic/norm.js +++ b/src/function/arithmetic/norm.js @@ -55,27 +55,27 @@ export const createNorm = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | BigNumber} the p-norm */ const norm = typed(name, { - 'number': Math.abs, + number: Math.abs, - 'Complex': function (x) { + Complex: function (x) { return x.abs() }, - 'BigNumber': function (x) { + BigNumber: function (x) { // norm(x) = abs(x) return x.abs() }, - 'boolean': function (x) { + boolean: function (x) { // norm(x) = abs(x) return Math.abs(x) }, - 'Array': function (x) { + Array: function (x) { return _norm(matrix(x), 2) }, - 'Matrix': function (x) { + Matrix: function (x) { return _norm(x, 2) }, diff --git a/src/function/arithmetic/nthRoot.js b/src/function/arithmetic/nthRoot.js index 3d75fbd05..e7c3a71a4 100644 --- a/src/function/arithmetic/nthRoot.js +++ b/src/function/arithmetic/nthRoot.js @@ -58,16 +58,16 @@ export const createNthRoot = /* #__PURE__ */ factory(name, dependencies, ({ type ) const nthRoot = typed(name, { - 'number': function (x) { + number: function (x) { return nthRootNumber(x, 2) }, 'number, number': nthRootNumber, - 'BigNumber': function (x) { + BigNumber: function (x) { return _bigNthRoot(x, new BigNumber(2)) }, - 'Complex': function (x) { + Complex: function (x) { throw new Error(complexErr) }, 'Complex, number': function (x, y) { @@ -203,7 +203,7 @@ export const createNthRoot = /* #__PURE__ */ factory(name, dependencies, ({ type export const createNthRootNumber = /* #__PURE__ */ factory(name, ['typed'], ({ typed }) => { return typed(name, { - 'number': nthRootNumber, + number: nthRootNumber, 'number, number': nthRootNumber }) }) diff --git a/src/function/arithmetic/nthRoots.js b/src/function/arithmetic/nthRoots.js index dff39a270..9931e447b 100644 --- a/src/function/arithmetic/nthRoots.js +++ b/src/function/arithmetic/nthRoots.js @@ -37,7 +37,7 @@ export const createNthRoots = /* #__PURE__ */ factory(name, dependencies, ({ typ * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value */ const nthRoots = typed(name, { - 'Complex': function (x) { + Complex: function (x) { return _nthComplexRoots(x, 2) }, 'Complex, number': _nthComplexRoots diff --git a/src/function/arithmetic/round.js b/src/function/arithmetic/round.js index 772633ecb..5fb5521e3 100644 --- a/src/function/arithmetic/round.js +++ b/src/function/arithmetic/round.js @@ -57,7 +57,7 @@ export const createRound = /* #__PURE__ */ factory(name, dependencies, ({ typed, const round = typed(name, { ...roundNumberSignatures, - 'Complex': function (x) { + Complex: function (x) { return x.round() }, @@ -80,7 +80,7 @@ export const createRound = /* #__PURE__ */ factory(name, dependencies, ({ typed, return new BigNumber(x).toDecimalPlaces(n.toNumber()) }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.toDecimalPlaces(0) }, @@ -90,7 +90,7 @@ export const createRound = /* #__PURE__ */ factory(name, dependencies, ({ typed, return x.toDecimalPlaces(n.toNumber()) }, - 'Fraction': function (x) { + Fraction: function (x) { return x.round() }, @@ -145,7 +145,7 @@ export const createRound = /* #__PURE__ */ factory(name, dependencies, ({ typed, }) const roundNumberSignatures = { - 'number': roundNumber, + number: roundNumber, 'number, number': function (x, n) { if (!isInteger(n)) { throw new TypeError(NO_INT) } diff --git a/src/function/arithmetic/sign.js b/src/function/arithmetic/sign.js index e1dd0b292..fc4e9b595 100644 --- a/src/function/arithmetic/sign.js +++ b/src/function/arithmetic/sign.js @@ -37,17 +37,17 @@ export const createSign = /* #__PURE__ */ factory(name, dependencies, ({ typed, * The sign of `x` */ const sign = typed(name, { - 'number': signNumber, + number: signNumber, - 'Complex': function (x) { + Complex: function (x) { return x.sign() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return new BigNumber(x.cmp(0)) }, - 'Fraction': function (x) { + Fraction: function (x) { return new Fraction(x.s, 1) }, @@ -56,7 +56,7 @@ export const createSign = /* #__PURE__ */ factory(name, dependencies, ({ typed, return deepMap(x, sign, true) }, - 'Unit': function (x) { + Unit: function (x) { return sign(x.value) } }) diff --git a/src/function/arithmetic/sqrt.js b/src/function/arithmetic/sqrt.js index 9913cb559..982bf6c6b 100644 --- a/src/function/arithmetic/sqrt.js +++ b/src/function/arithmetic/sqrt.js @@ -30,13 +30,13 @@ export const createSqrt = /* #__PURE__ */ factory(name, dependencies, ({ config, * Returns the square root of `x` */ const sqrt = typed('sqrt', { - 'number': _sqrtNumber, + number: _sqrtNumber, - 'Complex': function (x) { + Complex: function (x) { return x.sqrt() }, - 'BigNumber': function (x) { + BigNumber: function (x) { if (!x.isNegative() || config.predictable) { return x.sqrt() } else { @@ -50,7 +50,7 @@ export const createSqrt = /* #__PURE__ */ factory(name, dependencies, ({ config, return deepMap(x, sqrt, true) }, - 'Unit': function (x) { + Unit: function (x) { // Someday will work for complex units when they are implemented return x.pow(0.5) } diff --git a/src/function/arithmetic/square.js b/src/function/arithmetic/square.js index 9538b3e30..8d601e7ae 100644 --- a/src/function/arithmetic/square.js +++ b/src/function/arithmetic/square.js @@ -33,17 +33,17 @@ export const createSquare = /* #__PURE__ */ factory(name, dependencies, ({ typed * Squared value */ const square = typed(name, { - 'number': squareNumber, + number: squareNumber, - 'Complex': function (x) { + Complex: function (x) { return x.mul(x) }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.times(x) }, - 'Fraction': function (x) { + Fraction: function (x) { return x.mul(x) }, @@ -52,7 +52,7 @@ export const createSquare = /* #__PURE__ */ factory(name, dependencies, ({ typed return deepMap(x, square, true) }, - 'Unit': function (x) { + Unit: function (x) { return x.pow(2) } }) diff --git a/src/function/arithmetic/unaryMinus.js b/src/function/arithmetic/unaryMinus.js index c25d96567..6554028e4 100644 --- a/src/function/arithmetic/unaryMinus.js +++ b/src/function/arithmetic/unaryMinus.js @@ -30,21 +30,21 @@ export const createUnaryMinus = /* #__PURE__ */ factory(name, dependencies, ({ t * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Returns the value with inverted sign. */ const unaryMinus = typed(name, { - 'number': unaryMinusNumber, + number: unaryMinusNumber, - 'Complex': function (x) { + Complex: function (x) { return x.neg() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.neg() }, - 'Fraction': function (x) { + Fraction: function (x) { return x.neg() }, - 'Unit': function (x) { + Unit: function (x) { const res = x.clone() res.value = unaryMinus(x.value) return res diff --git a/src/function/arithmetic/unaryPlus.js b/src/function/arithmetic/unaryPlus.js index 8ebffa214..b83809b97 100644 --- a/src/function/arithmetic/unaryPlus.js +++ b/src/function/arithmetic/unaryPlus.js @@ -31,21 +31,21 @@ export const createUnaryPlus = /* #__PURE__ */ factory(name, dependencies, ({ ty * Returns the input value when numeric, converts to a number when input is non-numeric. */ const unaryPlus = typed(name, { - 'number': unaryPlusNumber, + number: unaryPlusNumber, - 'Complex': function (x) { + Complex: function (x) { return x // complex numbers are immutable }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x // bignumbers are immutable }, - 'Fraction': function (x) { + Fraction: function (x) { return x // fractions are immutable }, - 'Unit': function (x) { + Unit: function (x) { return x.clone() }, diff --git a/src/function/bitwise/bitNot.js b/src/function/bitwise/bitNot.js index 89ade04e6..e7d55da7f 100644 --- a/src/function/bitwise/bitNot.js +++ b/src/function/bitwise/bitNot.js @@ -30,9 +30,9 @@ export const createBitNot = /* #__PURE__ */ factory(name, dependencies, ({ typed * @return {number | BigNumber | Array | Matrix} NOT of `x` */ const bitNot = typed(name, { - 'number': bitNotNumber, + number: bitNotNumber, - 'BigNumber': bitNotBigNumber, + BigNumber: bitNotBigNumber, 'Array | Matrix': function (x) { return deepMap(x, bitNot) diff --git a/src/function/complex/arg.js b/src/function/complex/arg.js index 6e694232a..b4efff281 100644 --- a/src/function/complex/arg.js +++ b/src/function/complex/arg.js @@ -33,15 +33,15 @@ export const createArg = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @return {number | BigNumber | Array | Matrix} The argument of x */ const arg = typed(name, { - 'number': function (x) { + number: function (x) { return Math.atan2(0, x) }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.constructor.atan2(0, x) }, - 'Complex': function (x) { + Complex: function (x) { return x.arg() }, diff --git a/src/function/complex/conj.js b/src/function/complex/conj.js index fe9c53446..99dade276 100644 --- a/src/function/complex/conj.js +++ b/src/function/complex/conj.js @@ -31,15 +31,15 @@ export const createConj = /* #__PURE__ */ factory(name, dependencies, ({ typed } * The complex conjugate of x */ const conj = typed(name, { - 'number': function (x) { + number: function (x) { return x }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x }, - 'Complex': function (x) { + Complex: function (x) { return x.conjugate() }, diff --git a/src/function/complex/im.js b/src/function/complex/im.js index 287e8cef4..04d3845a7 100644 --- a/src/function/complex/im.js +++ b/src/function/complex/im.js @@ -33,15 +33,15 @@ export const createIm = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @return {number | BigNumber | Array | Matrix} The imaginary part of x */ const im = typed(name, { - 'number': function (x) { + number: function (x) { return 0 }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.mul(0) }, - 'Complex': function (x) { + Complex: function (x) { return x.im }, diff --git a/src/function/complex/re.js b/src/function/complex/re.js index 645c77fed..8b63fe7d7 100644 --- a/src/function/complex/re.js +++ b/src/function/complex/re.js @@ -33,15 +33,15 @@ export const createRe = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @return {number | BigNumber | Array | Matrix} The real part of x */ const re = typed(name, { - 'number': function (x) { + number: function (x) { return x }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x }, - 'Complex': function (x) { + Complex: function (x) { return x.re }, diff --git a/src/function/geometry/distance.js b/src/function/geometry/distance.js index 7be1090c0..ac38782e8 100644 --- a/src/function/geometry/distance.js +++ b/src/function/geometry/distance.js @@ -87,8 +87,8 @@ export const createDistance = /* #__PURE__ */ factory(name, dependencies, ({ typ if (!_2d(x)) { throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers') } if (!_2d(y)) { throw new TypeError('Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers') } if (!_2d(z)) { throw new TypeError('Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers') } - if (x.hasOwnProperty('pointX') && x.hasOwnProperty('pointY') && y.hasOwnProperty('lineOnePtX') && - y.hasOwnProperty('lineOnePtY') && z.hasOwnProperty('lineTwoPtX') && z.hasOwnProperty('lineTwoPtY')) { + if ('pointX' in x && 'pointY' in x && 'lineOnePtX' in y && + 'lineOnePtY' in y && 'lineTwoPtX' in z && 'lineTwoPtY' in z) { const m = divideScalar(subtract(z.lineTwoPtY, z.lineTwoPtX), subtract(y.lineOnePtY, y.lineOnePtX)) const xCoeff = multiplyScalar(multiplyScalar(m, m), y.lineOnePtX) const yCoeff = unaryMinus(multiplyScalar(m, y.lineOnePtX)) @@ -155,8 +155,7 @@ export const createDistance = /* #__PURE__ */ factory(name, dependencies, ({ typ if (!_3d(y)) { throw new TypeError('Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers') } - if (x.hasOwnProperty('pointX') && x.hasOwnProperty('pointY') && y.hasOwnProperty('xCoeffLine') && - y.hasOwnProperty('yCoeffLine') && y.hasOwnProperty('constant')) { + if ('pointX' in x && 'pointY' in x && 'xCoeffLine' in y && 'yCoeffLine' in y && 'constant' in y) { return _distancePointLine2D(x.pointX, x.pointY, y.xCoeffLine, y.yCoeffLine, y.constant) } else { throw new TypeError('Key names do not match') @@ -169,9 +168,7 @@ export const createDistance = /* #__PURE__ */ factory(name, dependencies, ({ typ if (!_parametricLine(y)) { throw new TypeError('Values of x0, y0, z0, a, b and c should be numbers or BigNumbers') } - if (x.hasOwnProperty('pointX') && x.hasOwnProperty('pointY') && y.hasOwnProperty('x0') && - y.hasOwnProperty('y0') && y.hasOwnProperty('z0') && y.hasOwnProperty('a') && - y.hasOwnProperty('b') && y.hasOwnProperty('c')) { + if ('pointX' in x && 'pointY' in x && 'x0' in y && 'y0' in y && 'z0' in y && 'a' in y && 'b' in y && 'c' in y) { return _distancePointLine3D(x.pointX, x.pointY, x.pointZ, y.x0, y.y0, y.z0, y.a, y.b, y.c) } else { throw new TypeError('Key names do not match') @@ -184,8 +181,7 @@ export const createDistance = /* #__PURE__ */ factory(name, dependencies, ({ typ if (!_2d(y)) { throw new TypeError('Values of pointTwoX and pointTwoY should be numbers or BigNumbers') } - if (x.hasOwnProperty('pointOneX') && x.hasOwnProperty('pointOneY') && - y.hasOwnProperty('pointTwoX') && y.hasOwnProperty('pointTwoY')) { + if ('pointOneX' in x && 'pointOneY' in x && 'pointTwoX' in y && 'pointTwoY' in y) { return _distance2d(x.pointOneX, x.pointOneY, y.pointTwoX, y.pointTwoY) } else { throw new TypeError('Key names do not match') @@ -198,8 +194,9 @@ export const createDistance = /* #__PURE__ */ factory(name, dependencies, ({ typ if (!_3d(y)) { throw new TypeError('Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers') } - if (x.hasOwnProperty('pointOneX') && x.hasOwnProperty('pointOneY') && x.hasOwnProperty('pointOneZ') && - y.hasOwnProperty('pointTwoX') && y.hasOwnProperty('pointTwoY') && y.hasOwnProperty('pointTwoZ')) { + if ('pointOneX' in x && 'pointOneY' in x && 'pointOneZ' in x && + 'pointTwoX' in y && 'pointTwoY' in y && 'pointTwoZ' in y + ) { return _distance3d(x.pointOneX, x.pointOneY, x.pointOneZ, y.pointTwoX, y.pointTwoY, y.pointTwoZ) } else { throw new TypeError('Key names do not match') @@ -208,7 +205,7 @@ export const createDistance = /* #__PURE__ */ factory(name, dependencies, ({ typ throw new TypeError('Invalid Arguments: Try again') } }, - 'Array': function (arr) { + Array: function (arr) { if (!_pairwise(arr)) { throw new TypeError('Incorrect array format entered for pairwise distance calculation') } return _distancePairwise(arr) @@ -276,9 +273,9 @@ export const createDistance = /* #__PURE__ */ factory(name, dependencies, ({ typ } function _distancePointLine3D (x, y, z, x0, y0, z0, a, b, c) { - let num = [ subtract(multiplyScalar(subtract(y0, y), c), multiplyScalar(subtract(z0, z), b)), + let num = [subtract(multiplyScalar(subtract(y0, y), c), multiplyScalar(subtract(z0, z), b)), subtract(multiplyScalar(subtract(z0, z), a), multiplyScalar(subtract(x0, x), c)), - subtract(multiplyScalar(subtract(x0, x), b), multiplyScalar(subtract(y0, y), a)) ] + subtract(multiplyScalar(subtract(x0, x), b), multiplyScalar(subtract(y0, y), a))] num = sqrt(addScalar(addScalar(multiplyScalar(num[0], num[0]), multiplyScalar(num[1], num[1])), multiplyScalar(num[2], num[2]))) const den = sqrt(addScalar(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)), multiplyScalar(c, c))) return divideScalar(num, den) diff --git a/src/function/logical/not.js b/src/function/logical/not.js index 39c20b056..9d2e44d51 100644 --- a/src/function/logical/not.js +++ b/src/function/logical/not.js @@ -32,17 +32,17 @@ export const createNot = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * Returns true when input is a zero or empty value. */ const not = typed(name, { - 'number': notNumber, + number: notNumber, - 'Complex': function (x) { + Complex: function (x) { return x.re === 0 && x.im === 0 }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.isZero() || x.isNaN() }, - 'Unit': function (x) { + Unit: function (x) { return x.value !== null ? not(x.value) : true }, diff --git a/src/function/matrix/ctranspose.js b/src/function/matrix/ctranspose.js index 44cfd58ef..e80065008 100644 --- a/src/function/matrix/ctranspose.js +++ b/src/function/matrix/ctranspose.js @@ -27,7 +27,7 @@ export const createCtranspose = /* #__PURE__ */ factory(name, dependencies, ({ t * @return {Array | Matrix} The ctransposed matrix */ return typed(name, { - 'any': function (x) { + any: function (x) { return conj(transpose(x)) } }) diff --git a/src/function/matrix/det.js b/src/function/matrix/det.js index f58c33c37..d0fbaab32 100644 --- a/src/function/matrix/det.js +++ b/src/function/matrix/det.js @@ -33,7 +33,7 @@ export const createDet = /* #__PURE__ */ factory(name, dependencies, ({ typed, m * @return {number} The determinant of `x` */ return typed(name, { - 'any': function (x) { + any: function (x) { return clone(x) }, diff --git a/src/function/matrix/diag.js b/src/function/matrix/diag.js index 4192be909..093c04c9d 100644 --- a/src/function/matrix/diag.js +++ b/src/function/matrix/diag.js @@ -47,7 +47,7 @@ export const createDiag = /* #__PURE__ */ factory(name, dependencies, ({ typed, return typed(name, { // FIXME: simplify this huge amount of signatures as soon as typed-function supports optional arguments - 'Array': function (x) { + Array: function (x) { return _diag(x, 0, arraySize(x), null) }, @@ -71,7 +71,7 @@ export const createDiag = /* #__PURE__ */ factory(name, dependencies, ({ typed, return _diag(x, k.toNumber(), arraySize(x), format) }, - 'Matrix': function (x) { + Matrix: function (x) { return _diag(x, 0, x.size(), x.storage()) }, diff --git a/src/function/matrix/expm.js b/src/function/matrix/expm.js index 5c45de059..8a3e4560f 100644 --- a/src/function/matrix/expm.js +++ b/src/function/matrix/expm.js @@ -33,7 +33,7 @@ export const createExpm = /* #__PURE__ */ factory(name, dependencies, ({ typed, */ return typed(name, { - 'Matrix': function (A) { + Matrix: function (A) { // Check matrix size const size = A.size() diff --git a/src/function/matrix/flatten.js b/src/function/matrix/flatten.js index 1e857bf7a..880f6634f 100644 --- a/src/function/matrix/flatten.js +++ b/src/function/matrix/flatten.js @@ -25,11 +25,11 @@ export const createFlatten = /* #__PURE__ */ factory(name, dependencies, ({ type * @return {Matrix | Array} Returns the flattened matrix */ return typed(name, { - 'Array': function (x) { + Array: function (x) { return flattenArray(clone(x)) }, - 'Matrix': function (x) { + Matrix: function (x) { const flat = flattenArray(clone(x.toArray())) // TODO: return the same matrix type as x return matrix(flat) diff --git a/src/function/matrix/getMatrixDataType.js b/src/function/matrix/getMatrixDataType.js index be0c5b135..a3aa8fa9f 100644 --- a/src/function/matrix/getMatrixDataType.js +++ b/src/function/matrix/getMatrixDataType.js @@ -41,10 +41,10 @@ export const createGetMatrixDataType = /* #__PURE__ */ factory(name, dependencie * @return {string} A string representation of the matrix type */ return typed(name, { - 'Array': function (x) { + Array: function (x) { return getArrayDataType(x, typeOf) }, - 'Matrix': function (x) { + Matrix: function (x) { return x.getDataType() } }) diff --git a/src/function/matrix/identity.js b/src/function/matrix/identity.js index a11e67cd7..1e12e3326 100644 --- a/src/function/matrix/identity.js +++ b/src/function/matrix/identity.js @@ -49,7 +49,7 @@ export const createIdentity = /* #__PURE__ */ factory(name, dependencies, ({ typ return (config.matrix === 'Matrix') ? matrix([]) : [] }, - 'string': function (format) { + string: function (format) { return matrix(format) }, @@ -69,7 +69,7 @@ export const createIdentity = /* #__PURE__ */ factory(name, dependencies, ({ typ return _identity(rows, cols, format) }, - 'Array': function (size) { + Array: function (size) { return _identityVector(size) }, @@ -77,7 +77,7 @@ export const createIdentity = /* #__PURE__ */ factory(name, dependencies, ({ typ return _identityVector(size, format) }, - 'Matrix': function (size) { + Matrix: function (size) { return _identityVector(size.valueOf(), size.storage()) }, diff --git a/src/function/matrix/inv.js b/src/function/matrix/inv.js index a57c43e0b..65e81d42b 100644 --- a/src/function/matrix/inv.js +++ b/src/function/matrix/inv.js @@ -84,7 +84,7 @@ export const createInv = /* #__PURE__ */ factory(name, dependencies, ({ typed, m } }, - 'any': function (x) { + any: function (x) { // scalar return divideScalar(1, x) // FIXME: create a BigNumber one when configured for bignumbers } diff --git a/src/function/matrix/kron.js b/src/function/matrix/kron.js index f155234dd..8b931e526 100644 --- a/src/function/matrix/kron.js +++ b/src/function/matrix/kron.js @@ -69,7 +69,7 @@ export const createKron = /* #__PURE__ */ factory(name, dependencies, ({ typed, throw new RangeError('Vectors with dimensions greater then 2 are not supported expected ' + '(Size x = ' + JSON.stringify(a.length) + ', y = ' + JSON.stringify(b.length) + ')') } - let t = [] + const t = [] let r = [] return a.map(function (a) { diff --git a/src/function/matrix/ones.js b/src/function/matrix/ones.js index f3872d002..5b8c47745 100644 --- a/src/function/matrix/ones.js +++ b/src/function/matrix/ones.js @@ -61,9 +61,9 @@ export const createOnes = /* #__PURE__ */ factory(name, dependencies, ({ typed, } }, - 'Array': _ones, + Array: _ones, - 'Matrix': function (size) { + Matrix: function (size) { const format = size.storage() return _ones(size.valueOf(), format) }, diff --git a/src/function/matrix/range.js b/src/function/matrix/range.js index 53cf28816..35b36816f 100644 --- a/src/function/matrix/range.js +++ b/src/function/matrix/range.js @@ -52,7 +52,7 @@ export const createRange = /* #__PURE__ */ factory(name, dependencies, ({ typed, // TODO: simplify signatures when typed-function supports default values and optional arguments // TODO: a number or boolean should not be converted to string here - 'string': _strRange, + string: _strRange, 'string, boolean': _strRange, 'number, number': function (start, end) { diff --git a/src/function/matrix/size.js b/src/function/matrix/size.js index 368f0bacb..e3d6fd4ff 100644 --- a/src/function/matrix/size.js +++ b/src/function/matrix/size.js @@ -30,13 +30,13 @@ export const createSize = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {Array | Matrix} A vector with size of `x`. */ return typed(name, { - 'Matrix': function (x) { + Matrix: function (x) { return x.create(x.size()) }, - 'Array': arraySize, + Array: arraySize, - 'string': function (x) { + string: function (x) { return (config.matrix === 'Array') ? [x.length] : matrix([x.length]) }, diff --git a/src/function/matrix/sort.js b/src/function/matrix/sort.js index b4ea3a597..49a773dad 100644 --- a/src/function/matrix/sort.js +++ b/src/function/matrix/sort.js @@ -40,12 +40,12 @@ export const createSort = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {Matrix | Array} Returns the sorted matrix. */ return typed(name, { - 'Array': function (x) { + Array: function (x) { _arrayIsVector(x) return x.sort(compareAsc) }, - 'Matrix': function (x) { + Matrix: function (x) { _matrixIsVector(x) return matrix(x.toArray().sort(compareAsc), x.storage()) }, diff --git a/src/function/matrix/squeeze.js b/src/function/matrix/squeeze.js index a6d305911..5c31042af 100644 --- a/src/function/matrix/squeeze.js +++ b/src/function/matrix/squeeze.js @@ -36,17 +36,17 @@ export const createSqueeze = /* #__PURE__ */ factory(name, dependencies, ({ type * @return {Matrix | Array} Squeezed matrix */ return typed(name, { - 'Array': function (x) { + Array: function (x) { return arraySqueeze(clone(x)) }, - 'Matrix': function (x) { + Matrix: function (x) { const res = arraySqueeze(x.toArray()) // FIXME: return the same type of matrix as the input return Array.isArray(res) ? matrix(res) : res }, - 'any': function (x) { + any: function (x) { // scalar return clone(x) } diff --git a/src/function/matrix/trace.js b/src/function/matrix/trace.js index bfee2cf34..fc9980700 100644 --- a/src/function/matrix/trace.js +++ b/src/function/matrix/trace.js @@ -34,16 +34,16 @@ export const createTrace = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number} The trace of `x` */ return typed('trace', { - 'Array': function _arrayTrace (x) { + Array: function _arrayTrace (x) { // use dense matrix implementation return _denseTrace(matrix(x)) }, - 'SparseMatrix': _sparseTrace, + SparseMatrix: _sparseTrace, - 'DenseMatrix': _denseTrace, + DenseMatrix: _denseTrace, - 'any': clone + any: clone }) function _denseTrace (m) { diff --git a/src/function/matrix/transpose.js b/src/function/matrix/transpose.js index f947ac3de..1c6798597 100644 --- a/src/function/matrix/transpose.js +++ b/src/function/matrix/transpose.js @@ -30,12 +30,12 @@ export const createTranspose = /* #__PURE__ */ factory(name, dependencies, ({ ty */ const transpose = typed('transpose', { - 'Array': function (x) { + Array: function (x) { // use dense matrix implementation return transpose(matrix(x)).valueOf() }, - 'Matrix': function (x) { + Matrix: function (x) { // matrix size const size = x.size() @@ -79,7 +79,7 @@ export const createTranspose = /* #__PURE__ */ factory(name, dependencies, ({ ty }, // scalars - 'any': function (x) { + any: function (x) { return clone(x) } }) diff --git a/src/function/matrix/zeros.js b/src/function/matrix/zeros.js index e091b4f47..c3888055d 100644 --- a/src/function/matrix/zeros.js +++ b/src/function/matrix/zeros.js @@ -59,9 +59,9 @@ export const createZeros = /* #__PURE__ */ factory(name, dependencies, ({ typed, } }, - 'Array': _zeros, + Array: _zeros, - 'Matrix': function (size) { + Matrix: function (size) { const format = size.storage() return _zeros(size.valueOf(), format) }, diff --git a/src/function/probability/factorial.js b/src/function/probability/factorial.js index 1535ac08f..fdb9528c9 100644 --- a/src/function/probability/factorial.js +++ b/src/function/probability/factorial.js @@ -28,7 +28,7 @@ export const createFactorial = /* #__PURE__ */ factory(name, dependencies, ({ ty * @return {number | BigNumber | Array | Matrix} The factorial of `n` */ const factorial = typed(name, { - 'number': function (n) { + number: function (n) { if (n < 0) { throw new Error('Value must be non-negative') } @@ -36,7 +36,7 @@ export const createFactorial = /* #__PURE__ */ factory(name, dependencies, ({ ty return gamma(n + 1) }, - 'BigNumber': function (n) { + BigNumber: function (n) { if (n.isNegative()) { throw new Error('Value must be non-negative') } diff --git a/src/function/probability/gamma.js b/src/function/probability/gamma.js index c3bd95040..08baa8367 100644 --- a/src/function/probability/gamma.js +++ b/src/function/probability/gamma.js @@ -32,17 +32,15 @@ export const createGamma = /* #__PURE__ */ factory(name, dependencies, ({ typed, const gamma = typed(name, { - 'number': gammaNumber, - - 'Complex': function (n) { - let t, x + number: gammaNumber, + Complex: function (n) { if (n.im === 0) { return gamma(n.re) } n = new Complex(n.re - 1, n.im) - x = new Complex(gammaP[0], 0) + const x = new Complex(gammaP[0], 0) for (let i = 1; i < gammaP.length; ++i) { const real = n.re + i // x += p[i]/(n+i) const den = real * real + n.im * n.im @@ -56,7 +54,7 @@ export const createGamma = /* #__PURE__ */ factory(name, dependencies, ({ typed, } } - t = new Complex(n.re + gammaG + 0.5, n.im) + const t = new Complex(n.re + gammaG + 0.5, n.im) const twoPiSqrt = Math.sqrt(2 * Math.PI) n.re += 0.5 @@ -77,7 +75,7 @@ export const createGamma = /* #__PURE__ */ factory(name, dependencies, ({ typed, return multiplyScalar(multiplyScalar(result, t), x) }, - 'BigNumber': function (n) { + BigNumber: function (n) { if (n.isInteger()) { return (n.isNegative() || n.isZero()) ? new BigNumber(Infinity) diff --git a/src/function/probability/random.js b/src/function/probability/random.js index 783b00cce..9ffdd0557 100644 --- a/src/function/probability/random.js +++ b/src/function/probability/random.js @@ -50,7 +50,7 @@ export const createRandom = /* #__PURE__ */ factory(name, dependencies, ({ typed */ return typed(name, { '': () => _random(0, 1), - 'number': (max) => _random(0, max), + number: (max) => _random(0, max), 'number, number': (min, max) => _random(min, max), 'Array | Matrix': (size) => _randomMatrix(size, 0, 1), 'Array | Matrix, number': (size, max) => _randomMatrix(size, 0, max), @@ -83,7 +83,7 @@ export const createRandomNumber = /* #__PURE__ */ factory(name, ['typed', 'confi return typed(name, { '': () => _random(0, 1), - 'number': (max) => _random(0, max), + number: (max) => _random(0, max), 'number, number': (min, max) => _random(min, max) }) diff --git a/src/function/probability/randomInt.js b/src/function/probability/randomInt.js index f66e94da2..775e23f45 100644 --- a/src/function/probability/randomInt.js +++ b/src/function/probability/randomInt.js @@ -49,7 +49,7 @@ export const createRandomInt = /* #__PURE__ */ factory(name, dependencies, ({ ty */ return typed(name, { '': () => _randomInt(0, 1), - 'number': (max) => _randomInt(0, max), + number: (max) => _randomInt(0, max), 'number, number': (min, max) => _randomInt(min, max), 'Array | Matrix': (size) => _randomIntMatrix(size, 0, 1), 'Array | Matrix, number': (size, max) => _randomIntMatrix(size, 0, max), diff --git a/src/function/special/erf.js b/src/function/special/erf.js index 3d069e452..34317afab 100644 --- a/src/function/special/erf.js +++ b/src/function/special/erf.js @@ -33,7 +33,7 @@ export const createErf = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @return {number | Array | Matrix} The erf of `x` */ const erf = typed('name', { - 'number': function (x) { + number: function (x) { const y = Math.abs(x) if (y >= MAX_NUM) { diff --git a/src/function/string/format.js b/src/function/string/format.js index 2d3d662ad..e592b8496 100644 --- a/src/function/string/format.js +++ b/src/function/string/format.js @@ -106,7 +106,7 @@ export const createFormat = /* #__PURE__ */ factory(name, dependencies, ({ typed * @return {string} The formatted value */ return typed(name, { - 'any': formatString, + any: formatString, 'any, Object | function | number': formatString }) }) diff --git a/src/function/trigonometry/acos.js b/src/function/trigonometry/acos.js index 8513a683e..aff0ba1ed 100644 --- a/src/function/trigonometry/acos.js +++ b/src/function/trigonometry/acos.js @@ -29,7 +29,7 @@ export const createAcos = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | BigNumber | Complex | Array | Matrix} The arc cosine of x */ const acos = typed(name, { - 'number': function (x) { + number: function (x) { if ((x >= -1 && x <= 1) || config.predictable) { return Math.acos(x) } else { @@ -37,11 +37,11 @@ export const createAcos = /* #__PURE__ */ factory(name, dependencies, ({ typed, } }, - 'Complex': function (x) { + Complex: function (x) { return x.acos() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.acos() }, diff --git a/src/function/trigonometry/acosh.js b/src/function/trigonometry/acosh.js index ebd526d82..730caebbe 100644 --- a/src/function/trigonometry/acosh.js +++ b/src/function/trigonometry/acosh.js @@ -28,7 +28,7 @@ export const createAcosh = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | Complex | Array | Matrix} Hyperbolic arccosine of x */ const acosh = typed(name, { - 'number': function (x) { + number: function (x) { if (x >= 1 || config.predictable) { return acoshNumber(x) } @@ -38,11 +38,11 @@ export const createAcosh = /* #__PURE__ */ factory(name, dependencies, ({ typed, return new Complex(x, 0).acosh() }, - 'Complex': function (x) { + Complex: function (x) { return x.acosh() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.acosh() }, diff --git a/src/function/trigonometry/acot.js b/src/function/trigonometry/acot.js index 827cc7bae..b129cca84 100644 --- a/src/function/trigonometry/acot.js +++ b/src/function/trigonometry/acot.js @@ -30,13 +30,13 @@ export const createAcot = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | Complex | Array | Matrix} The arc cotangent of x */ const acot = typed(name, { - 'number': acotNumber, + number: acotNumber, - 'Complex': function (x) { + Complex: function (x) { return x.acot() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return new BigNumber(1).div(x).atan() }, diff --git a/src/function/trigonometry/acoth.js b/src/function/trigonometry/acoth.js index b31c16c17..1796dc1d6 100644 --- a/src/function/trigonometry/acoth.js +++ b/src/function/trigonometry/acoth.js @@ -28,18 +28,18 @@ export const createAcoth = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | Complex | Array | Matrix} Hyperbolic arccotangent of x */ const acoth = typed(name, { - 'number': function (x) { + number: function (x) { if (x >= 1 || x <= -1 || config.predictable) { return acothNumber(x) } return new Complex(x, 0).acoth() }, - 'Complex': function (x) { + Complex: function (x) { return x.acoth() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return new BigNumber(1).div(x).atanh() }, diff --git a/src/function/trigonometry/acsc.js b/src/function/trigonometry/acsc.js index 5d4d134cf..74c748e49 100644 --- a/src/function/trigonometry/acsc.js +++ b/src/function/trigonometry/acsc.js @@ -30,18 +30,18 @@ export const createAcsc = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | Complex | Array | Matrix} The arc cosecant of x */ const acsc = typed(name, { - 'number': function (x) { + number: function (x) { if (x <= -1 || x >= 1 || config.predictable) { return acscNumber(x) } return new Complex(x, 0).acsc() }, - 'Complex': function (x) { + Complex: function (x) { return x.acsc() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return new BigNumber(1).div(x).asin() }, diff --git a/src/function/trigonometry/acsch.js b/src/function/trigonometry/acsch.js index c86fad735..75a8b5ff8 100644 --- a/src/function/trigonometry/acsch.js +++ b/src/function/trigonometry/acsch.js @@ -28,13 +28,13 @@ export const createAcsch = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | Complex | Array | Matrix} Hyperbolic arccosecant of x */ const acsch = typed(name, { - 'number': acschNumber, + number: acschNumber, - 'Complex': function (x) { + Complex: function (x) { return x.acsch() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return new BigNumber(1).div(x).asinh() }, diff --git a/src/function/trigonometry/asec.js b/src/function/trigonometry/asec.js index bca0d5ba7..1c6844967 100644 --- a/src/function/trigonometry/asec.js +++ b/src/function/trigonometry/asec.js @@ -30,18 +30,18 @@ export const createAsec = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | Complex | Array | Matrix} The arc secant of x */ const asec = typed(name, { - 'number': function (x) { + number: function (x) { if (x <= -1 || x >= 1 || config.predictable) { return asecNumber(x) } return new Complex(x, 0).asec() }, - 'Complex': function (x) { + Complex: function (x) { return x.asec() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return new BigNumber(1).div(x).acos() }, diff --git a/src/function/trigonometry/asech.js b/src/function/trigonometry/asech.js index 44ef321a5..091bbd682 100644 --- a/src/function/trigonometry/asech.js +++ b/src/function/trigonometry/asech.js @@ -28,7 +28,7 @@ export const createAsech = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | Complex | Array | Matrix} Hyperbolic arcsecant of x */ const asech = typed(name, { - 'number': function (x) { + number: function (x) { if ((x <= 1 && x >= -1) || config.predictable) { const xInv = 1 / x if (xInv > 0 || config.predictable) { @@ -42,11 +42,11 @@ export const createAsech = /* #__PURE__ */ factory(name, dependencies, ({ typed, return new Complex(x, 0).asech() }, - 'Complex': function (x) { + Complex: function (x) { return x.asech() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return new BigNumber(1).div(x).acosh() }, diff --git a/src/function/trigonometry/asin.js b/src/function/trigonometry/asin.js index f322dd435..7fb871748 100644 --- a/src/function/trigonometry/asin.js +++ b/src/function/trigonometry/asin.js @@ -29,7 +29,7 @@ export const createAsin = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | BigNumber | Complex | Array | Matrix} The arc sine of x */ const asin = typed(name, { - 'number': function (x) { + number: function (x) { if ((x >= -1 && x <= 1) || config.predictable) { return Math.asin(x) } else { @@ -37,11 +37,11 @@ export const createAsin = /* #__PURE__ */ factory(name, dependencies, ({ typed, } }, - 'Complex': function (x) { + Complex: function (x) { return x.asin() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.asin() }, diff --git a/src/function/trigonometry/asinh.js b/src/function/trigonometry/asinh.js index 16313b291..5bb34449d 100644 --- a/src/function/trigonometry/asinh.js +++ b/src/function/trigonometry/asinh.js @@ -28,13 +28,13 @@ export const createAsinh = /* #__PURE__ */ factory(name, dependencies, ({ typed * @return {number | Complex | Array | Matrix} Hyperbolic arcsine of x */ const asinh = typed('asinh', { - 'number': asinhNumber, + number: asinhNumber, - 'Complex': function (x) { + Complex: function (x) { return x.asinh() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.asinh() }, diff --git a/src/function/trigonometry/atan.js b/src/function/trigonometry/atan.js index a044bc9bf..d1fc80b10 100644 --- a/src/function/trigonometry/atan.js +++ b/src/function/trigonometry/atan.js @@ -29,15 +29,15 @@ export const createAtan = /* #__PURE__ */ factory(name, dependencies, ({ typed } * @return {number | BigNumber | Complex | Array | Matrix} The arc tangent of x */ const atan = typed('atan', { - 'number': function (x) { + number: function (x) { return Math.atan(x) }, - 'Complex': function (x) { + Complex: function (x) { return x.atan() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.atan() }, diff --git a/src/function/trigonometry/atanh.js b/src/function/trigonometry/atanh.js index 7580e3f92..7100322e5 100644 --- a/src/function/trigonometry/atanh.js +++ b/src/function/trigonometry/atanh.js @@ -28,18 +28,18 @@ export const createAtanh = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | Complex | Array | Matrix} Hyperbolic arctangent of x */ const atanh = typed(name, { - 'number': function (x) { + number: function (x) { if ((x <= 1 && x >= -1) || config.predictable) { return atanhNumber(x) } return new Complex(x, 0).atanh() }, - 'Complex': function (x) { + Complex: function (x) { return x.atanh() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.atanh() }, diff --git a/src/function/trigonometry/cos.js b/src/function/trigonometry/cos.js index 19c1d5a1d..1e1b8577a 100644 --- a/src/function/trigonometry/cos.js +++ b/src/function/trigonometry/cos.js @@ -32,17 +32,17 @@ export const createCos = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @return {number | BigNumber | Complex | Array | Matrix} Cosine of x */ const cos = typed(name, { - 'number': Math.cos, + number: Math.cos, - 'Complex': function (x) { + Complex: function (x) { return x.cos() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.cos() }, - 'Unit': function (x) { + Unit: function (x) { if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function cos is no angle') } diff --git a/src/function/trigonometry/cosh.js b/src/function/trigonometry/cosh.js index 167165a6f..83f930883 100644 --- a/src/function/trigonometry/cosh.js +++ b/src/function/trigonometry/cosh.js @@ -28,17 +28,17 @@ export const createCosh = /* #__PURE__ */ factory(name, dependencies, ({ typed } * @return {number | BigNumber | Complex | Array | Matrix} Hyperbolic cosine of x */ const cosh = typed(name, { - 'number': coshNumber, + number: coshNumber, - 'Complex': function (x) { + Complex: function (x) { return x.cosh() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.cosh() }, - 'Unit': function (x) { + Unit: function (x) { if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function cosh is no angle') } diff --git a/src/function/trigonometry/cot.js b/src/function/trigonometry/cot.js index caa7bffa4..29cf7cc38 100644 --- a/src/function/trigonometry/cot.js +++ b/src/function/trigonometry/cot.js @@ -28,17 +28,17 @@ export const createCot = /* #__PURE__ */ factory(name, dependencies, ({ typed, B * @return {number | Complex | Array | Matrix} Cotangent of x */ const cot = typed(name, { - 'number': cotNumber, + number: cotNumber, - 'Complex': function (x) { + Complex: function (x) { return x.cot() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return new BigNumber(1).div(x.tan()) }, - 'Unit': function (x) { + Unit: function (x) { if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function cot is no angle') } diff --git a/src/function/trigonometry/coth.js b/src/function/trigonometry/coth.js index 58282e194..61511f182 100644 --- a/src/function/trigonometry/coth.js +++ b/src/function/trigonometry/coth.js @@ -30,17 +30,17 @@ export const createCoth = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | Complex | Array | Matrix} Hyperbolic cotangent of x */ const coth = typed(name, { - 'number': cothNumber, + number: cothNumber, - 'Complex': function (x) { + Complex: function (x) { return x.coth() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return new BigNumber(1).div(x.tanh()) }, - 'Unit': function (x) { + Unit: function (x) { if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function coth is no angle') } diff --git a/src/function/trigonometry/csc.js b/src/function/trigonometry/csc.js index 8c9a7348c..ac4060022 100644 --- a/src/function/trigonometry/csc.js +++ b/src/function/trigonometry/csc.js @@ -28,17 +28,17 @@ export const createCsc = /* #__PURE__ */ factory(name, dependencies, ({ typed, B * @return {number | Complex | Array | Matrix} Cosecant of x */ const csc = typed(name, { - 'number': cscNumber, + number: cscNumber, - 'Complex': function (x) { + Complex: function (x) { return x.csc() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return new BigNumber(1).div(x.sin()) }, - 'Unit': function (x) { + Unit: function (x) { if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function csc is no angle') } diff --git a/src/function/trigonometry/csch.js b/src/function/trigonometry/csch.js index a04cb2ab3..2fd656d81 100644 --- a/src/function/trigonometry/csch.js +++ b/src/function/trigonometry/csch.js @@ -30,17 +30,17 @@ export const createCsch = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | Complex | Array | Matrix} Hyperbolic cosecant of x */ const csch = typed(name, { - 'number': cschNumber, + number: cschNumber, - 'Complex': function (x) { + Complex: function (x) { return x.csch() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return new BigNumber(1).div(x.sinh()) }, - 'Unit': function (x) { + Unit: function (x) { if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function csch is no angle') } diff --git a/src/function/trigonometry/sec.js b/src/function/trigonometry/sec.js index 204f43a02..6172b43a3 100644 --- a/src/function/trigonometry/sec.js +++ b/src/function/trigonometry/sec.js @@ -28,17 +28,17 @@ export const createSec = /* #__PURE__ */ factory(name, dependencies, ({ typed, B * @return {number | Complex | Array | Matrix} Secant of x */ const sec = typed(name, { - 'number': secNumber, + number: secNumber, - 'Complex': function (x) { + Complex: function (x) { return x.sec() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return new BigNumber(1).div(x.cos()) }, - 'Unit': function (x) { + Unit: function (x) { if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function sec is no angle') } diff --git a/src/function/trigonometry/sech.js b/src/function/trigonometry/sech.js index 5c27eea25..68ca3d2e1 100644 --- a/src/function/trigonometry/sech.js +++ b/src/function/trigonometry/sech.js @@ -30,17 +30,17 @@ export const createSech = /* #__PURE__ */ factory(name, dependencies, ({ typed, * @return {number | Complex | Array | Matrix} Hyperbolic secant of x */ const sech = typed(name, { - 'number': sechNumber, + number: sechNumber, - 'Complex': function (x) { + Complex: function (x) { return x.sech() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return new BigNumber(1).div(x.cosh()) }, - 'Unit': function (x) { + Unit: function (x) { if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function sech is no angle') } diff --git a/src/function/trigonometry/sin.js b/src/function/trigonometry/sin.js index 69b4c6aa1..23efb5e4d 100644 --- a/src/function/trigonometry/sin.js +++ b/src/function/trigonometry/sin.js @@ -32,17 +32,17 @@ export const createSin = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @return {number | BigNumber | Complex | Array | Matrix} Sine of x */ const sin = typed(name, { - 'number': Math.sin, + number: Math.sin, - 'Complex': function (x) { + Complex: function (x) { return x.sin() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.sin() }, - 'Unit': function (x) { + Unit: function (x) { if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function sin is no angle') } diff --git a/src/function/trigonometry/sinh.js b/src/function/trigonometry/sinh.js index 29bf9a4a6..b7b595135 100644 --- a/src/function/trigonometry/sinh.js +++ b/src/function/trigonometry/sinh.js @@ -28,17 +28,17 @@ export const createSinh = /* #__PURE__ */ factory(name, dependencies, ({ typed } * @return {number | BigNumber | Complex | Array | Matrix} Hyperbolic sine of x */ const sinh = typed(name, { - 'number': sinhNumber, + number: sinhNumber, - 'Complex': function (x) { + Complex: function (x) { return x.sinh() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.sinh() }, - 'Unit': function (x) { + Unit: function (x) { if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function sinh is no angle') } diff --git a/src/function/trigonometry/tan.js b/src/function/trigonometry/tan.js index d5314fda3..9b757b8d0 100644 --- a/src/function/trigonometry/tan.js +++ b/src/function/trigonometry/tan.js @@ -29,17 +29,17 @@ export const createTan = /* #__PURE__ */ factory(name, dependencies, ({ typed }) * @return {number | BigNumber | Complex | Array | Matrix} Tangent of x */ const tan = typed(name, { - 'number': Math.tan, + number: Math.tan, - 'Complex': function (x) { + Complex: function (x) { return x.tan() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.tan() }, - 'Unit': function (x) { + Unit: function (x) { if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function tan is no angle') } diff --git a/src/function/trigonometry/tanh.js b/src/function/trigonometry/tanh.js index 848ca84f3..08c4e439e 100644 --- a/src/function/trigonometry/tanh.js +++ b/src/function/trigonometry/tanh.js @@ -31,17 +31,17 @@ export const createTanh = /* #__PURE__ */ factory(name, dependencies, ({ typed } * @return {number | BigNumber | Complex | Array | Matrix} Hyperbolic tangent of x */ const tanh = typed('tanh', { - 'number': _tanh, + number: _tanh, - 'Complex': function (x) { + Complex: function (x) { return x.tanh() }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.tanh() }, - 'Unit': function (x) { + Unit: function (x) { if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { throw new TypeError('Unit in function tanh is no angle') } diff --git a/src/function/utils/clone.js b/src/function/utils/clone.js index 64aa3b7bd..f0b29afd6 100644 --- a/src/function/utils/clone.js +++ b/src/function/utils/clone.js @@ -24,6 +24,6 @@ export const createClone = /* #__PURE__ */ factory(name, dependencies, ({ typed * @return {*} A clone of object x */ return typed(name, { - 'any': objectClone + any: objectClone }) }) diff --git a/src/function/utils/hasNumericValue.js b/src/function/utils/hasNumericValue.js index 65df789d4..fdd9db9b1 100644 --- a/src/function/utils/hasNumericValue.js +++ b/src/function/utils/hasNumericValue.js @@ -34,10 +34,10 @@ export const createHasNumericValue = /* #__PURE__ */ factory(name, dependencies, * Throws an error in case of unknown types. */ return typed(name, { - 'string': function (x) { + string: function (x) { return x.trim().length > 0 && !isNaN(Number(x)) }, - 'any': function (x) { + any: function (x) { return isNumeric(x) } }) diff --git a/src/function/utils/isInteger.js b/src/function/utils/isInteger.js index 7782d2987..36dc9f6fb 100644 --- a/src/function/utils/isInteger.js +++ b/src/function/utils/isInteger.js @@ -36,13 +36,13 @@ export const createIsInteger = /* #__PURE__ */ factory(name, dependencies, ({ ty * Throws an error in case of an unknown data type. */ const isInteger = typed(name, { - 'number': isIntegerNumber, // TODO: what to do with isInteger(add(0.1, 0.2)) ? + number: isIntegerNumber, // TODO: what to do with isInteger(add(0.1, 0.2)) ? - 'BigNumber': function (x) { + BigNumber: function (x) { return x.isInt() }, - 'Fraction': function (x) { + Fraction: function (x) { return x.d === 1 && isFinite(x.n) }, diff --git a/src/function/utils/isNaN.js b/src/function/utils/isNaN.js index 267068684..85abf0e63 100644 --- a/src/function/utils/isNaN.js +++ b/src/function/utils/isNaN.js @@ -36,21 +36,21 @@ export const createIsNaN = /* #__PURE__ */ factory(name, dependencies, ({ typed * Throws an error in case of an unknown data type. */ return typed(name, { - 'number': isNaNNumber, + number: isNaNNumber, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.isNaN() }, - 'Fraction': function (x) { + Fraction: function (x) { return false }, - 'Complex': function (x) { + Complex: function (x) { return x.isNaN() }, - 'Unit': function (x) { + Unit: function (x) { return Number.isNaN(x.value) }, diff --git a/src/function/utils/isNegative.js b/src/function/utils/isNegative.js index 0283be66d..62ac59d16 100644 --- a/src/function/utils/isNegative.js +++ b/src/function/utils/isNegative.js @@ -36,17 +36,17 @@ export const createIsNegative = /* #__PURE__ */ factory(name, dependencies, ({ t * Throws an error in case of an unknown data type. */ const isNegative = typed(name, { - 'number': isNegativeNumber, + number: isNegativeNumber, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.isNeg() && !x.isZero() && !x.isNaN() }, - 'Fraction': function (x) { + Fraction: function (x) { return x.s < 0 // It's enough to decide on the sign }, - 'Unit': function (x) { + Unit: function (x) { return isNegative(x.value) }, diff --git a/src/function/utils/isPositive.js b/src/function/utils/isPositive.js index 7c83f3e33..086cc394c 100644 --- a/src/function/utils/isPositive.js +++ b/src/function/utils/isPositive.js @@ -38,17 +38,17 @@ export const createIsPositive = /* #__PURE__ */ factory(name, dependencies, ({ t * Throws an error in case of an unknown data type. */ const isPositive = typed(name, { - 'number': isPositiveNumber, + number: isPositiveNumber, - 'BigNumber': function (x) { + BigNumber: function (x) { return !x.isNeg() && !x.isZero() && !x.isNaN() }, - 'Fraction': function (x) { + Fraction: function (x) { return x.s > 0 && x.n > 0 }, - 'Unit': function (x) { + Unit: function (x) { return isPositive(x.value) }, diff --git a/src/function/utils/isPrime.js b/src/function/utils/isPrime.js index a8f3cfaef..6899e4231 100644 --- a/src/function/utils/isPrime.js +++ b/src/function/utils/isPrime.js @@ -34,7 +34,7 @@ export const createIsPrime = /* #__PURE__ */ factory(name, dependencies, ({ type * Throws an error in case of an unknown data type. */ const isPrime = typed(name, { - 'number': function (x) { + number: function (x) { if (x < 2) { return false } @@ -52,7 +52,7 @@ export const createIsPrime = /* #__PURE__ */ factory(name, dependencies, ({ type return true }, - 'BigNumber': function (x) { + BigNumber: function (x) { if (x.lt(2)) { return false } diff --git a/src/function/utils/isZero.js b/src/function/utils/isZero.js index edf62a07a..57843c1c1 100644 --- a/src/function/utils/isZero.js +++ b/src/function/utils/isZero.js @@ -40,21 +40,21 @@ export const createIsZero = /* #__PURE__ */ factory(name, dependencies, ({ typed * Throws an error in case of an unknown data type. */ const isZero = typed(name, { - 'number': isZeroNumber, + number: isZeroNumber, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.isZero() }, - 'Complex': function (x) { + Complex: function (x) { return x.re === 0 && x.im === 0 }, - 'Fraction': function (x) { + Fraction: function (x) { return x.d === 1 && x.n === 0 }, - 'Unit': function (x) { + Unit: function (x) { return isZero(x.value) }, diff --git a/src/function/utils/numeric.js b/src/function/utils/numeric.js index 51faa6a73..ffb6d97f1 100644 --- a/src/function/utils/numeric.js +++ b/src/function/utils/numeric.js @@ -7,19 +7,19 @@ const dependencies = ['number', '?bignumber', '?fraction'] export const createNumeric = /* #__PURE__ */ factory(name, dependencies, ({ number, bignumber, fraction }) => { const validInputTypes = { - 'string': true, - 'number': true, - 'BigNumber': true, - 'Fraction': true + string: true, + number: true, + BigNumber: true, + Fraction: true } // Load the conversion functions for each output type const validOutputTypes = { - 'number': (x) => number(x), - 'BigNumber': bignumber + number: (x) => number(x), + BigNumber: bignumber ? (x) => bignumber(x) : noBignumber, - 'Fraction': fraction + Fraction: fraction ? (x) => fraction(x) : noFraction } diff --git a/src/function/utils/typeOf.js b/src/function/utils/typeOf.js index f58a3803f..42b0c2a7a 100644 --- a/src/function/utils/typeOf.js +++ b/src/function/utils/typeOf.js @@ -65,7 +65,7 @@ export const createTypeOf = /* #__PURE__ */ factory(name, dependencies, ({ typed * For example 'number', 'string', 'Array', 'Date'. */ return typed(name, { - 'any': _typeOf + any: _typeOf }) }) diff --git a/src/plain/number/combinations.js b/src/plain/number/combinations.js index e66c1b69d..6b5d9e049 100644 --- a/src/plain/number/combinations.js +++ b/src/plain/number/combinations.js @@ -2,8 +2,6 @@ import { isInteger } from '../../utils/number' import { product } from '../../utils/product' export function combinationsNumber (n, k) { - let prodrange, nMinusk - if (!isInteger(n) || n < 0) { throw new TypeError('Positive integer value expected in function combinations') } @@ -14,8 +12,9 @@ export function combinationsNumber (n, k) { throw new TypeError('k must be less than or equal to n') } - nMinusk = n - k + const nMinusk = n - k + let prodrange if (k < nMinusk) { prodrange = product(nMinusk + 1, n) return prodrange / product(1, k) diff --git a/src/plain/number/probability.js b/src/plain/number/probability.js index 0ebf152fe..d6032e5df 100644 --- a/src/plain/number/probability.js +++ b/src/plain/number/probability.js @@ -2,7 +2,7 @@ import { isInteger } from '../../utils/number' import { product } from '../../utils/product' export function gammaNumber (n) { - let t, x + let x if (isInteger(n)) { if (n <= 0) { @@ -41,7 +41,7 @@ export function gammaNumber (n) { x += gammaP[i] / (n + i) } - t = n + gammaG + 0.5 + const t = n + gammaG + 0.5 return Math.sqrt(2 * Math.PI) * Math.pow(t, n + 0.5) * Math.exp(-t) * x } gammaNumber.signature = 'number' diff --git a/src/type/bignumber/function/bignumber.js b/src/type/bignumber/function/bignumber.js index 21c9d64ec..b39000d49 100644 --- a/src/type/bignumber/function/bignumber.js +++ b/src/type/bignumber/function/bignumber.js @@ -35,25 +35,25 @@ export const createBignumber = /* #__PURE__ */ factory(name, dependencies, ({ ty return new BigNumber(0) }, - 'number': function (x) { + number: function (x) { // convert to string to prevent errors in case of >15 digits return new BigNumber(x + '') }, - 'string': function (x) { + string: function (x) { return new BigNumber(x) }, - 'BigNumber': function (x) { + BigNumber: function (x) { // we assume a BigNumber is immutable return x }, - 'Fraction': function (x) { + Fraction: function (x) { return new BigNumber(x.n).div(x.d).times(x.s) }, - 'null': function (x) { + null: function (x) { return new BigNumber(0) }, diff --git a/src/type/boolean.js b/src/type/boolean.js index 7fe9c8b06..e07b9d6f0 100644 --- a/src/type/boolean.js +++ b/src/type/boolean.js @@ -37,23 +37,23 @@ export const createBoolean = /* #__PURE__ */ factory(name, dependencies, ({ type return false }, - 'boolean': function (x) { + boolean: function (x) { return x }, - 'number': function (x) { + number: function (x) { return !!x }, - 'null': function (x) { + null: function (x) { return false }, - 'BigNumber': function (x) { + BigNumber: function (x) { return !x.isZero() }, - 'string': function (x) { + string: function (x) { // try case insensitive const lcase = x.toLowerCase() if (lcase === 'true') { diff --git a/src/type/chain/Chain.js b/src/type/chain/Chain.js index 5ea86420f..0e396bb6c 100644 --- a/src/type/chain/Chain.js +++ b/src/type/chain/Chain.js @@ -1,6 +1,6 @@ import { isChain } from '../../utils/is' import { format } from '../../utils/string' -import { lazy } from '../../utils/object' +import { hasOwnProperty, lazy } from '../../utils/object' import { factory } from '../../utils/factory' const name = 'Chain' @@ -160,7 +160,7 @@ export const createChainClass = /* #__PURE__ */ factory(name, dependencies, ({ o } else { // createProxy(values) for (const name in arg0) { - if (arg0.hasOwnProperty(name) && excludedNames[name] === undefined) { + if (hasOwnProperty(arg0, name) && excludedNames[name] === undefined) { createLazyProxy(name, () => arg0[name]) } } diff --git a/src/type/chain/function/chain.js b/src/type/chain/function/chain.js index efef506af..fffb9bd17 100644 --- a/src/type/chain/function/chain.js +++ b/src/type/chain/function/chain.js @@ -44,7 +44,7 @@ export const createChain = /* #__PURE__ */ factory(name, dependencies, ({ typed, return new Chain() }, - 'any': function (value) { + any: function (value) { return new Chain(value) } }) diff --git a/src/type/complex/function/complex.js b/src/type/complex/function/complex.js index f3992033b..bf39235f3 100644 --- a/src/type/complex/function/complex.js +++ b/src/type/complex/function/complex.js @@ -48,7 +48,7 @@ export const createComplex = /* #__PURE__ */ factory(name, dependencies, ({ type return Complex.ZERO }, - 'number': function (x) { + number: function (x) { return new Complex(x, 0) }, @@ -61,23 +61,23 @@ export const createComplex = /* #__PURE__ */ factory(name, dependencies, ({ type return new Complex(re.toNumber(), im.toNumber()) }, - 'Fraction': function (x) { + Fraction: function (x) { return new Complex(x.valueOf(), 0) }, - 'Complex': function (x) { + Complex: function (x) { return x.clone() }, - 'string': function (x) { + string: function (x) { return Complex(x) // for example '2 + 3i' }, - 'null': function (x) { + null: function (x) { return Complex(0) }, - 'Object': function (x) { + Object: function (x) { if ('re' in x && 'im' in x) { return new Complex(x.re, x.im) } diff --git a/src/type/fraction/function/fraction.js b/src/type/fraction/function/fraction.js index 0361cda5b..6d3c9c859 100644 --- a/src/type/fraction/function/fraction.js +++ b/src/type/fraction/function/fraction.js @@ -31,7 +31,7 @@ export const createFraction = /* #__PURE__ */ factory(name, dependencies, ({ typ * @return {Fraction | Array | Matrix} Returns a fraction */ const fraction = typed('fraction', { - 'number': function (x) { + number: function (x) { if (!isFinite(x) || isNaN(x)) { throw new Error(x + ' cannot be represented as a fraction') } @@ -39,7 +39,7 @@ export const createFraction = /* #__PURE__ */ factory(name, dependencies, ({ typ return new Fraction(x) }, - 'string': function (x) { + string: function (x) { return new Fraction(x) }, @@ -47,19 +47,19 @@ export const createFraction = /* #__PURE__ */ factory(name, dependencies, ({ typ return new Fraction(numerator, denominator) }, - 'null': function (x) { + null: function (x) { return new Fraction(0) }, - 'BigNumber': function (x) { + BigNumber: function (x) { return new Fraction(x.toString()) }, - 'Fraction': function (x) { + Fraction: function (x) { return x // fractions are immutable }, - 'Object': function (x) { + Object: function (x) { return new Fraction(x) }, diff --git a/src/type/matrix/function/matrix.js b/src/type/matrix/function/matrix.js index 2845c7a07..9a3896c35 100644 --- a/src/type/matrix/function/matrix.js +++ b/src/type/matrix/function/matrix.js @@ -1,7 +1,7 @@ import { factory } from '../../../utils/factory' const name = 'matrix' -const dependencies = [ 'typed', 'Matrix', 'DenseMatrix', 'SparseMatrix' ] +const dependencies = ['typed', 'Matrix', 'DenseMatrix', 'SparseMatrix'] export const createMatrix = /* #__PURE__ */ factory(name, dependencies, ({ typed, Matrix, DenseMatrix, SparseMatrix }) => { /** @@ -41,7 +41,7 @@ export const createMatrix = /* #__PURE__ */ factory(name, dependencies, ({ typed return _create([]) }, - 'string': function (format) { + string: function (format) { return _create([], format) }, @@ -49,11 +49,11 @@ export const createMatrix = /* #__PURE__ */ factory(name, dependencies, ({ typed return _create([], format, datatype) }, - 'Array': function (data) { + Array: function (data) { return _create(data) }, - 'Matrix': function (data) { + Matrix: function (data) { return _create(data, data.storage()) }, diff --git a/src/type/matrix/function/sparse.js b/src/type/matrix/function/sparse.js index 844861261..5e843db44 100644 --- a/src/type/matrix/function/sparse.js +++ b/src/type/matrix/function/sparse.js @@ -36,7 +36,7 @@ export const createSparse = /* #__PURE__ */ factory(name, dependencies, ({ typed return new SparseMatrix([]) }, - 'string': function (datatype) { + string: function (datatype) { return new SparseMatrix([], datatype) }, diff --git a/src/type/number.js b/src/type/number.js index c1c150432..e3d02f09d 100644 --- a/src/type/number.js +++ b/src/type/number.js @@ -35,11 +35,11 @@ export const createNumber = /* #__PURE__ */ factory(name, dependencies, ({ typed return 0 }, - 'number': function (x) { + number: function (x) { return x }, - 'string': function (x) { + string: function (x) { if (x === 'NaN') return NaN const num = Number(x) if (isNaN(num)) { @@ -48,19 +48,19 @@ export const createNumber = /* #__PURE__ */ factory(name, dependencies, ({ typed return num }, - 'BigNumber': function (x) { + BigNumber: function (x) { return x.toNumber() }, - 'Fraction': function (x) { + Fraction: function (x) { return x.valueOf() }, - 'Unit': function (x) { + Unit: function (x) { throw new Error('Second argument with valueless unit expected') }, - 'null': function (x) { + null: function (x) { return 0 }, diff --git a/src/type/string.js b/src/type/string.js index 6ed13a51f..e20fade45 100644 --- a/src/type/string.js +++ b/src/type/string.js @@ -36,17 +36,17 @@ export const createString = /* #__PURE__ */ factory(name, dependencies, ({ typed return '' }, - 'number': format, + number: format, - 'null': function (x) { + null: function (x) { return 'null' }, - 'boolean': function (x) { + boolean: function (x) { return x + '' }, - 'string': function (x) { + string: function (x) { return x }, @@ -54,7 +54,7 @@ export const createString = /* #__PURE__ */ factory(name, dependencies, ({ typed return deepMap(x, string) }, - 'any': function (x) { + any: function (x) { return String(x) } }) diff --git a/src/type/unit/Unit.js b/src/type/unit/Unit.js index 61a01567e..584ac1ec5 100644 --- a/src/type/unit/Unit.js +++ b/src/type/unit/Unit.js @@ -1,7 +1,7 @@ import { isComplex, isUnit, typeOf } from '../../utils/is' import { factory } from '../../utils/factory' import { endsWith } from '../../utils/string' -import { clone } from '../../utils/object' +import { clone, hasOwnProperty } from '../../utils/object' import { createBigNumberPi as createPi } from '../../utils/bignumber/constants' const name = 'Unit' @@ -140,8 +140,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ function parseNumber () { let number = '' - let oldIndex - oldIndex = index + const oldIndex = index if (c === '+') { next() @@ -460,7 +459,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ for (let i = 0; i < this.units.length; i++) { unit.units[i] = { } for (const p in this.units[i]) { - if (this.units[i].hasOwnProperty(p)) { + if (hasOwnProperty(this.units[i], p)) { unit.units[i][p] = this.units[i][p] } } @@ -575,7 +574,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ */ function _findUnit (str) { // First, match units names exactly. For example, a user could define 'mm' as 10^-4 m, which is silly, but then we would want 'mm' to match the user-defined unit. - if (UNITS.hasOwnProperty(str)) { + if (hasOwnProperty(UNITS, str)) { const unit = UNITS[str] const prefix = unit.prefixes[''] return { @@ -585,12 +584,12 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ } for (const name in UNITS) { - if (UNITS.hasOwnProperty(name)) { + if (hasOwnProperty(UNITS, name)) { if (endsWith(str, name)) { const unit = UNITS[name] const prefixLen = (str.length - name.length) const prefixName = str.substring(0, prefixLen) - const prefix = unit.prefixes.hasOwnProperty(prefixName) + const prefix = hasOwnProperty(unit.prefixes, prefixName) ? unit.prefixes[prefixName] : undefined if (prefix !== undefined) { @@ -956,7 +955,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ let matchingUnit if (matchingBase) { // Does the unit system have a matching unit? - if (currentUnitSystem.hasOwnProperty(matchingBase)) { + if (hasOwnProperty(currentUnitSystem, matchingBase)) { matchingUnit = currentUnitSystem[matchingBase] } } @@ -974,7 +973,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ for (let i = 0; i < BASE_DIMENSIONS.length; i++) { const baseDim = BASE_DIMENSIONS[i] if (Math.abs(ret.dimensions[i] || 0) > 1e-12) { - if (currentUnitSystem.hasOwnProperty(baseDim)) { + if (hasOwnProperty(currentUnitSystem, baseDim)) { proposedUnitList.push({ unit: currentUnitSystem[baseDim].unit, prefix: currentUnitSystem[baseDim].prefix, @@ -1011,7 +1010,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ for (let i = 0; i < BASE_DIMENSIONS.length; i++) { const baseDim = BASE_DIMENSIONS[i] if (Math.abs(ret.dimensions[i] || 0) > 1e-12) { - if (UNIT_SYSTEMS['si'].hasOwnProperty(baseDim)) { + if (hasOwnProperty(UNIT_SYSTEMS['si'], baseDim)) { proposedUnitList.push({ unit: UNIT_SYSTEMS['si'][baseDim].unit, prefix: UNIT_SYSTEMS['si'][baseDim].prefix, @@ -1182,7 +1181,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ bestDiff = Math.abs(bestDiff) const prefixes = this.units[0].unit.prefixes for (const p in prefixes) { - if (prefixes.hasOwnProperty(p)) { + if (hasOwnProperty(prefixes, p)) { const prefix = prefixes[p] if (prefix.scientific) { const diff = Math.abs( @@ -1266,150 +1265,150 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ SHORT: { '': { name: '', value: 1, scientific: true }, - 'da': { name: 'da', value: 1e1, scientific: false }, - 'h': { name: 'h', value: 1e2, scientific: false }, - 'k': { name: 'k', value: 1e3, scientific: true }, - 'M': { name: 'M', value: 1e6, scientific: true }, - 'G': { name: 'G', value: 1e9, scientific: true }, - 'T': { name: 'T', value: 1e12, scientific: true }, - 'P': { name: 'P', value: 1e15, scientific: true }, - 'E': { name: 'E', value: 1e18, scientific: true }, - 'Z': { name: 'Z', value: 1e21, scientific: true }, - 'Y': { name: 'Y', value: 1e24, scientific: true }, + da: { name: 'da', value: 1e1, scientific: false }, + h: { name: 'h', value: 1e2, scientific: false }, + k: { name: 'k', value: 1e3, scientific: true }, + M: { name: 'M', value: 1e6, scientific: true }, + G: { name: 'G', value: 1e9, scientific: true }, + T: { name: 'T', value: 1e12, scientific: true }, + P: { name: 'P', value: 1e15, scientific: true }, + E: { name: 'E', value: 1e18, scientific: true }, + Z: { name: 'Z', value: 1e21, scientific: true }, + Y: { name: 'Y', value: 1e24, scientific: true }, - 'd': { name: 'd', value: 1e-1, scientific: false }, - 'c': { name: 'c', value: 1e-2, scientific: false }, - 'm': { name: 'm', value: 1e-3, scientific: true }, - 'u': { name: 'u', value: 1e-6, scientific: true }, - 'n': { name: 'n', value: 1e-9, scientific: true }, - 'p': { name: 'p', value: 1e-12, scientific: true }, - 'f': { name: 'f', value: 1e-15, scientific: true }, - 'a': { name: 'a', value: 1e-18, scientific: true }, - 'z': { name: 'z', value: 1e-21, scientific: true }, - 'y': { name: 'y', value: 1e-24, scientific: true } + d: { name: 'd', value: 1e-1, scientific: false }, + c: { name: 'c', value: 1e-2, scientific: false }, + m: { name: 'm', value: 1e-3, scientific: true }, + u: { name: 'u', value: 1e-6, scientific: true }, + n: { name: 'n', value: 1e-9, scientific: true }, + p: { name: 'p', value: 1e-12, scientific: true }, + f: { name: 'f', value: 1e-15, scientific: true }, + a: { name: 'a', value: 1e-18, scientific: true }, + z: { name: 'z', value: 1e-21, scientific: true }, + y: { name: 'y', value: 1e-24, scientific: true } }, LONG: { '': { name: '', value: 1, scientific: true }, - 'deca': { name: 'deca', value: 1e1, scientific: false }, - 'hecto': { name: 'hecto', value: 1e2, scientific: false }, - 'kilo': { name: 'kilo', value: 1e3, scientific: true }, - 'mega': { name: 'mega', value: 1e6, scientific: true }, - 'giga': { name: 'giga', value: 1e9, scientific: true }, - 'tera': { name: 'tera', value: 1e12, scientific: true }, - 'peta': { name: 'peta', value: 1e15, scientific: true }, - 'exa': { name: 'exa', value: 1e18, scientific: true }, - 'zetta': { name: 'zetta', value: 1e21, scientific: true }, - 'yotta': { name: 'yotta', value: 1e24, scientific: true }, + deca: { name: 'deca', value: 1e1, scientific: false }, + hecto: { name: 'hecto', value: 1e2, scientific: false }, + kilo: { name: 'kilo', value: 1e3, scientific: true }, + mega: { name: 'mega', value: 1e6, scientific: true }, + giga: { name: 'giga', value: 1e9, scientific: true }, + tera: { name: 'tera', value: 1e12, scientific: true }, + peta: { name: 'peta', value: 1e15, scientific: true }, + exa: { name: 'exa', value: 1e18, scientific: true }, + zetta: { name: 'zetta', value: 1e21, scientific: true }, + yotta: { name: 'yotta', value: 1e24, scientific: true }, - 'deci': { name: 'deci', value: 1e-1, scientific: false }, - 'centi': { name: 'centi', value: 1e-2, scientific: false }, - 'milli': { name: 'milli', value: 1e-3, scientific: true }, - 'micro': { name: 'micro', value: 1e-6, scientific: true }, - 'nano': { name: 'nano', value: 1e-9, scientific: true }, - 'pico': { name: 'pico', value: 1e-12, scientific: true }, - 'femto': { name: 'femto', value: 1e-15, scientific: true }, - 'atto': { name: 'atto', value: 1e-18, scientific: true }, - 'zepto': { name: 'zepto', value: 1e-21, scientific: true }, - 'yocto': { name: 'yocto', value: 1e-24, scientific: true } + deci: { name: 'deci', value: 1e-1, scientific: false }, + centi: { name: 'centi', value: 1e-2, scientific: false }, + milli: { name: 'milli', value: 1e-3, scientific: true }, + micro: { name: 'micro', value: 1e-6, scientific: true }, + nano: { name: 'nano', value: 1e-9, scientific: true }, + pico: { name: 'pico', value: 1e-12, scientific: true }, + femto: { name: 'femto', value: 1e-15, scientific: true }, + atto: { name: 'atto', value: 1e-18, scientific: true }, + zepto: { name: 'zepto', value: 1e-21, scientific: true }, + yocto: { name: 'yocto', value: 1e-24, scientific: true } }, SQUARED: { '': { name: '', value: 1, scientific: true }, - 'da': { name: 'da', value: 1e2, scientific: false }, - 'h': { name: 'h', value: 1e4, scientific: false }, - 'k': { name: 'k', value: 1e6, scientific: true }, - 'M': { name: 'M', value: 1e12, scientific: true }, - 'G': { name: 'G', value: 1e18, scientific: true }, - 'T': { name: 'T', value: 1e24, scientific: true }, - 'P': { name: 'P', value: 1e30, scientific: true }, - 'E': { name: 'E', value: 1e36, scientific: true }, - 'Z': { name: 'Z', value: 1e42, scientific: true }, - 'Y': { name: 'Y', value: 1e48, scientific: true }, + da: { name: 'da', value: 1e2, scientific: false }, + h: { name: 'h', value: 1e4, scientific: false }, + k: { name: 'k', value: 1e6, scientific: true }, + M: { name: 'M', value: 1e12, scientific: true }, + G: { name: 'G', value: 1e18, scientific: true }, + T: { name: 'T', value: 1e24, scientific: true }, + P: { name: 'P', value: 1e30, scientific: true }, + E: { name: 'E', value: 1e36, scientific: true }, + Z: { name: 'Z', value: 1e42, scientific: true }, + Y: { name: 'Y', value: 1e48, scientific: true }, - 'd': { name: 'd', value: 1e-2, scientific: false }, - 'c': { name: 'c', value: 1e-4, scientific: false }, - 'm': { name: 'm', value: 1e-6, scientific: true }, - 'u': { name: 'u', value: 1e-12, scientific: true }, - 'n': { name: 'n', value: 1e-18, scientific: true }, - 'p': { name: 'p', value: 1e-24, scientific: true }, - 'f': { name: 'f', value: 1e-30, scientific: true }, - 'a': { name: 'a', value: 1e-36, scientific: true }, - 'z': { name: 'z', value: 1e-42, scientific: true }, - 'y': { name: 'y', value: 1e-48, scientific: true } + d: { name: 'd', value: 1e-2, scientific: false }, + c: { name: 'c', value: 1e-4, scientific: false }, + m: { name: 'm', value: 1e-6, scientific: true }, + u: { name: 'u', value: 1e-12, scientific: true }, + n: { name: 'n', value: 1e-18, scientific: true }, + p: { name: 'p', value: 1e-24, scientific: true }, + f: { name: 'f', value: 1e-30, scientific: true }, + a: { name: 'a', value: 1e-36, scientific: true }, + z: { name: 'z', value: 1e-42, scientific: true }, + y: { name: 'y', value: 1e-48, scientific: true } }, CUBIC: { '': { name: '', value: 1, scientific: true }, - 'da': { name: 'da', value: 1e3, scientific: false }, - 'h': { name: 'h', value: 1e6, scientific: false }, - 'k': { name: 'k', value: 1e9, scientific: true }, - 'M': { name: 'M', value: 1e18, scientific: true }, - 'G': { name: 'G', value: 1e27, scientific: true }, - 'T': { name: 'T', value: 1e36, scientific: true }, - 'P': { name: 'P', value: 1e45, scientific: true }, - 'E': { name: 'E', value: 1e54, scientific: true }, - 'Z': { name: 'Z', value: 1e63, scientific: true }, - 'Y': { name: 'Y', value: 1e72, scientific: true }, + da: { name: 'da', value: 1e3, scientific: false }, + h: { name: 'h', value: 1e6, scientific: false }, + k: { name: 'k', value: 1e9, scientific: true }, + M: { name: 'M', value: 1e18, scientific: true }, + G: { name: 'G', value: 1e27, scientific: true }, + T: { name: 'T', value: 1e36, scientific: true }, + P: { name: 'P', value: 1e45, scientific: true }, + E: { name: 'E', value: 1e54, scientific: true }, + Z: { name: 'Z', value: 1e63, scientific: true }, + Y: { name: 'Y', value: 1e72, scientific: true }, - 'd': { name: 'd', value: 1e-3, scientific: false }, - 'c': { name: 'c', value: 1e-6, scientific: false }, - 'm': { name: 'm', value: 1e-9, scientific: true }, - 'u': { name: 'u', value: 1e-18, scientific: true }, - 'n': { name: 'n', value: 1e-27, scientific: true }, - 'p': { name: 'p', value: 1e-36, scientific: true }, - 'f': { name: 'f', value: 1e-45, scientific: true }, - 'a': { name: 'a', value: 1e-54, scientific: true }, - 'z': { name: 'z', value: 1e-63, scientific: true }, - 'y': { name: 'y', value: 1e-72, scientific: true } + d: { name: 'd', value: 1e-3, scientific: false }, + c: { name: 'c', value: 1e-6, scientific: false }, + m: { name: 'm', value: 1e-9, scientific: true }, + u: { name: 'u', value: 1e-18, scientific: true }, + n: { name: 'n', value: 1e-27, scientific: true }, + p: { name: 'p', value: 1e-36, scientific: true }, + f: { name: 'f', value: 1e-45, scientific: true }, + a: { name: 'a', value: 1e-54, scientific: true }, + z: { name: 'z', value: 1e-63, scientific: true }, + y: { name: 'y', value: 1e-72, scientific: true } }, BINARY_SHORT_SI: { '': { name: '', value: 1, scientific: true }, - 'k': { name: 'k', value: 1e3, scientific: true }, - 'M': { name: 'M', value: 1e6, scientific: true }, - 'G': { name: 'G', value: 1e9, scientific: true }, - 'T': { name: 'T', value: 1e12, scientific: true }, - 'P': { name: 'P', value: 1e15, scientific: true }, - 'E': { name: 'E', value: 1e18, scientific: true }, - 'Z': { name: 'Z', value: 1e21, scientific: true }, - 'Y': { name: 'Y', value: 1e24, scientific: true } + k: { name: 'k', value: 1e3, scientific: true }, + M: { name: 'M', value: 1e6, scientific: true }, + G: { name: 'G', value: 1e9, scientific: true }, + T: { name: 'T', value: 1e12, scientific: true }, + P: { name: 'P', value: 1e15, scientific: true }, + E: { name: 'E', value: 1e18, scientific: true }, + Z: { name: 'Z', value: 1e21, scientific: true }, + Y: { name: 'Y', value: 1e24, scientific: true } }, BINARY_SHORT_IEC: { '': { name: '', value: 1, scientific: true }, - 'Ki': { name: 'Ki', value: 1024, scientific: true }, - 'Mi': { name: 'Mi', value: Math.pow(1024, 2), scientific: true }, - 'Gi': { name: 'Gi', value: Math.pow(1024, 3), scientific: true }, - 'Ti': { name: 'Ti', value: Math.pow(1024, 4), scientific: true }, - 'Pi': { name: 'Pi', value: Math.pow(1024, 5), scientific: true }, - 'Ei': { name: 'Ei', value: Math.pow(1024, 6), scientific: true }, - 'Zi': { name: 'Zi', value: Math.pow(1024, 7), scientific: true }, - 'Yi': { name: 'Yi', value: Math.pow(1024, 8), scientific: true } + Ki: { name: 'Ki', value: 1024, scientific: true }, + Mi: { name: 'Mi', value: Math.pow(1024, 2), scientific: true }, + Gi: { name: 'Gi', value: Math.pow(1024, 3), scientific: true }, + Ti: { name: 'Ti', value: Math.pow(1024, 4), scientific: true }, + Pi: { name: 'Pi', value: Math.pow(1024, 5), scientific: true }, + Ei: { name: 'Ei', value: Math.pow(1024, 6), scientific: true }, + Zi: { name: 'Zi', value: Math.pow(1024, 7), scientific: true }, + Yi: { name: 'Yi', value: Math.pow(1024, 8), scientific: true } }, BINARY_LONG_SI: { '': { name: '', value: 1, scientific: true }, - 'kilo': { name: 'kilo', value: 1e3, scientific: true }, - 'mega': { name: 'mega', value: 1e6, scientific: true }, - 'giga': { name: 'giga', value: 1e9, scientific: true }, - 'tera': { name: 'tera', value: 1e12, scientific: true }, - 'peta': { name: 'peta', value: 1e15, scientific: true }, - 'exa': { name: 'exa', value: 1e18, scientific: true }, - 'zetta': { name: 'zetta', value: 1e21, scientific: true }, - 'yotta': { name: 'yotta', value: 1e24, scientific: true } + kilo: { name: 'kilo', value: 1e3, scientific: true }, + mega: { name: 'mega', value: 1e6, scientific: true }, + giga: { name: 'giga', value: 1e9, scientific: true }, + tera: { name: 'tera', value: 1e12, scientific: true }, + peta: { name: 'peta', value: 1e15, scientific: true }, + exa: { name: 'exa', value: 1e18, scientific: true }, + zetta: { name: 'zetta', value: 1e21, scientific: true }, + yotta: { name: 'yotta', value: 1e24, scientific: true } }, BINARY_LONG_IEC: { '': { name: '', value: 1, scientific: true }, - 'kibi': { name: 'kibi', value: 1024, scientific: true }, - 'mebi': { name: 'mebi', value: Math.pow(1024, 2), scientific: true }, - 'gibi': { name: 'gibi', value: Math.pow(1024, 3), scientific: true }, - 'tebi': { name: 'tebi', value: Math.pow(1024, 4), scientific: true }, - 'pebi': { name: 'pebi', value: Math.pow(1024, 5), scientific: true }, - 'exi': { name: 'exi', value: Math.pow(1024, 6), scientific: true }, - 'zebi': { name: 'zebi', value: Math.pow(1024, 7), scientific: true }, - 'yobi': { name: 'yobi', value: Math.pow(1024, 8), scientific: true } + kibi: { name: 'kibi', value: 1024, scientific: true }, + mebi: { name: 'mebi', value: Math.pow(1024, 2), scientific: true }, + gibi: { name: 'gibi', value: Math.pow(1024, 3), scientific: true }, + tebi: { name: 'tebi', value: Math.pow(1024, 4), scientific: true }, + pebi: { name: 'pebi', value: Math.pow(1024, 5), scientific: true }, + exi: { name: 'exi', value: Math.pow(1024, 6), scientific: true }, + zebi: { name: 'zebi', value: Math.pow(1024, 7), scientific: true }, + yobi: { name: 'yobi', value: Math.pow(1024, 8), scientific: true } }, BTU: { '': { name: '', value: 1, scientific: true }, - 'MM': { name: 'MM', value: 1e6, scientific: true } + MM: { name: 'MM', value: 1e6, scientific: true } } } @@ -1516,7 +1515,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ } } - for (let key in BASE_UNITS) { + for (const key in BASE_UNITS) { BASE_UNITS[key].key = key } @@ -1597,7 +1596,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ value: 1, offset: 0 }, - 'in': { + in: { name: 'in', base: BASE_UNITS.LENGTH, prefixes: PREFIXES.NONE, @@ -2942,7 +2941,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ * @param {string} [name] The name of the unit system. */ Unit.setUnitSystem = function (name) { - if (UNIT_SYSTEMS.hasOwnProperty(name)) { + if (hasOwnProperty(UNIT_SYSTEMS, name)) { currentUnitSystem = UNIT_SYSTEMS[name] } else { throw new Error('Unit system ' + name + ' does not exist. Choices are: ' + Object.keys(UNIT_SYSTEMS).join(', ')) @@ -3000,18 +2999,18 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ } // Add dimensions to each built-in unit - for (let key in UNITS) { + for (const key in UNITS) { const unit = UNITS[key] unit.dimensions = unit.base.dimensions } // Create aliases for (const name in ALIASES) { - if (ALIASES.hasOwnProperty(name)) { + if (hasOwnProperty(ALIASES, name)) { const unit = UNITS[ALIASES[name]] const alias = {} - for (let key in unit) { - if (unit.hasOwnProperty(key)) { + for (const key in unit) { + if (hasOwnProperty(unit, key)) { alias[key] = unit[key] } } @@ -3064,8 +3063,8 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ // Remove all units and aliases we are overriding if (options && options.override) { - for (let key in obj) { - if (obj.hasOwnProperty(key)) { + for (const key in obj) { + if (hasOwnProperty(obj, key)) { Unit.deleteUnit(key) } if (obj[key].aliases) { @@ -3078,8 +3077,8 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ // TODO: traverse multiple times until all units have been added let lastUnit - for (let key in obj) { - if (obj.hasOwnProperty(key)) { + for (const key in obj) { + if (hasOwnProperty(obj, key)) { lastUnit = Unit.createUnitSingle(key, obj[key]) } } @@ -3111,7 +3110,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ } // Check collisions with existing units - if (UNITS.hasOwnProperty(name)) { + if (hasOwnProperty(UNITS, name)) { throw new Error('Cannot create unit "' + name + '": a unit with that name already exists') } @@ -3143,7 +3142,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ if (aliases) { for (let i = 0; i < aliases.length; i++) { - if (UNITS.hasOwnProperty(aliases[i])) { + if (hasOwnProperty(UNITS, aliases[i])) { throw new Error('Cannot create alias "' + aliases[i] + '": a unit with that name already exists') } } @@ -3177,13 +3176,13 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ // Push 0 onto existing base units for (const b in BASE_UNITS) { - if (BASE_UNITS.hasOwnProperty(b)) { + if (hasOwnProperty(BASE_UNITS, b)) { BASE_UNITS[b].dimensions[BASE_DIMENSIONS.length - 1] = 0 } } // Add the new base unit - let newBaseUnit = { dimensions: [] } + const newBaseUnit = { dimensions: [] } for (let i = 0; i < BASE_DIMENSIONS.length; i++) { newBaseUnit.dimensions[i] = 0 } @@ -3215,8 +3214,8 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ // Create a new base if no matching base exists let anyMatch = false - for (let i in BASE_UNITS) { - if (BASE_UNITS.hasOwnProperty(i)) { + for (const i in BASE_UNITS) { + if (hasOwnProperty(BASE_UNITS, i)) { let match = true for (let j = 0; j < BASE_DIMENSIONS.length; j++) { if (Math.abs((newUnit.dimensions[j] || 0) - (BASE_UNITS[i].dimensions[j] || 0)) > 1e-12) { @@ -3234,7 +3233,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ if (!anyMatch) { const baseName = name + '_STUFF' // foo --> foo_STUFF, or the essence of foo // Add the new base unit - let newBaseUnit = { dimensions: defUnit.dimensions.slice(0) } + const newBaseUnit = { dimensions: defUnit.dimensions.slice(0) } newBaseUnit.key = baseName BASE_UNITS[baseName] = newBaseUnit @@ -3253,7 +3252,7 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({ const aliasName = aliases[i] const alias = {} for (const key in newUnit) { - if (newUnit.hasOwnProperty(key)) { + if (hasOwnProperty(newUnit, key)) { alias[key] = newUnit[key] } } diff --git a/src/type/unit/function/createUnit.js b/src/type/unit/function/createUnit.js index 2f194d997..235e099ae 100644 --- a/src/type/unit/function/createUnit.js +++ b/src/type/unit/function/createUnit.js @@ -53,7 +53,7 @@ export const createCreateUnit = /* #__PURE__ */ factory(name, dependencies, ({ t }, // Same as above but without the options. - 'Object': function (obj) { + Object: function (obj) { return Unit.createUnit(obj, {}) }, @@ -72,7 +72,7 @@ export const createCreateUnit = /* #__PURE__ */ factory(name, dependencies, ({ t }, // Without a definition, creates a base unit. - 'string': function (name) { + string: function (name) { const obj = {} obj[name] = {} return Unit.createUnit(obj, {}) diff --git a/src/type/unit/function/unit.js b/src/type/unit/function/unit.js index 1336c6e03..3a8308d0a 100644 --- a/src/type/unit/function/unit.js +++ b/src/type/unit/function/unit.js @@ -31,11 +31,11 @@ export const createUnitFunction = /* #__PURE__ */ factory(name, dependencies, ({ */ const unit = typed(name, { - 'Unit': function (x) { + Unit: function (x) { return x.clone() }, - 'string': function (x) { + string: function (x) { if (Unit.isValuelessUnit(x)) { return new Unit(null, x) // a pure unit } diff --git a/src/utils/array.js b/src/utils/array.js index 605163d21..2f3330a4e 100644 --- a/src/utils/array.js +++ b/src/utils/array.js @@ -12,7 +12,7 @@ import { IndexError } from '../error/IndexError' * @Return {Number[]} size */ export function arraySize (x) { - let s = [] + const s = [] while (Array.isArray(x)) { s.push(x.length) @@ -281,7 +281,7 @@ function _reshape (array, sizes) { * @returns {Array} returns the array itself */ export function squeeze (array, size) { - let s = size || arraySize(array) + const s = size || arraySize(array) // squeeze outer dimensions while (Array.isArray(array) && array.length === 1) { @@ -342,7 +342,7 @@ function _squeeze (array, dims, dim) { * @private */ export function unsqueeze (array, dims, outer, size) { - let s = size || arraySize(array) + const s = size || arraySize(array) // unsqueeze outer dimensions if (outer) { @@ -396,7 +396,7 @@ export function flatten (array) { // if not an array, return as is return array } - let flat = [] + const flat = [] array.forEach(function callback (value) { if (Array.isArray(value)) { @@ -478,7 +478,7 @@ export function identify (a) { return a } - let b = [] + const b = [] let count = 0 b[0] = { value: a[0], identifier: 0 } for (let i = 1; i < a.length; i++) { @@ -506,7 +506,7 @@ export function generalize (a) { return a } - let b = [] + const b = [] for (let i = 0; i < a.length; i++) { b.push(a[i].value) } diff --git a/src/utils/bignumber/bitwise.js b/src/utils/bignumber/bitwise.js index 017bc6f39..5afcc464f 100644 --- a/src/utils/bignumber/bitwise.js +++ b/src/utils/bignumber/bitwise.js @@ -80,7 +80,7 @@ export function bitNotBigNumber (x) { const prevPrec = BigNumber.precision BigNumber.config({ precision: 1E9 }) - let result = x.plus(new BigNumber(1)) + const result = x.plus(new BigNumber(1)) result.s = -result.s || null BigNumber.config({ precision: prevPrec }) diff --git a/src/utils/latex.js b/src/utils/latex.js index 0d997624e..591020839 100644 --- a/src/utils/latex.js +++ b/src/utils/latex.js @@ -1,4 +1,5 @@ import escapeLatexLib from 'escape-latex' +import { hasOwnProperty } from './object' export const latexSymbols = { // GREEK LETTERS @@ -58,8 +59,8 @@ export const latexSymbols = { Omega: '\\Omega', omega: '\\omega', // logic - 'true': '\\mathrm{True}', - 'false': '\\mathrm{False}', + true: '\\mathrm{True}', + false: '\\mathrm{False}', // other i: 'i', // TODO use \i ?? inf: '\\infty', @@ -68,42 +69,42 @@ export const latexSymbols = { Infinity: '\\infty', oo: '\\infty', lim: '\\lim', - 'undefined': '\\mathbf{?}' + undefined: '\\mathbf{?}' } export const latexOperators = { - 'transpose': '^\\top', - 'ctranspose': '^H', - 'factorial': '!', - 'pow': '^', - 'dotPow': '.^\\wedge', // TODO find ideal solution - 'unaryPlus': '+', - 'unaryMinus': '-', - 'bitNot': '\\~', // TODO find ideal solution - 'not': '\\neg', - 'multiply': '\\cdot', - 'divide': '\\frac', // TODO how to handle that properly? - 'dotMultiply': '.\\cdot', // TODO find ideal solution - 'dotDivide': '.:', // TODO find ideal solution - 'mod': '\\mod', - 'add': '+', - 'subtract': '-', - 'to': '\\rightarrow', - 'leftShift': '<<', - 'rightArithShift': '>>', - 'rightLogShift': '>>>', - 'equal': '=', - 'unequal': '\\neq', - 'smaller': '<', - 'larger': '>', - 'smallerEq': '\\leq', - 'largerEq': '\\geq', - 'bitAnd': '\\&', - 'bitXor': '\\underline{|}', - 'bitOr': '|', - 'and': '\\wedge', - 'xor': '\\veebar', - 'or': '\\vee' + transpose: '^\\top', + ctranspose: '^H', + factorial: '!', + pow: '^', + dotPow: '.^\\wedge', // TODO find ideal solution + unaryPlus: '+', + unaryMinus: '-', + bitNot: '\\~', // TODO find ideal solution + not: '\\neg', + multiply: '\\cdot', + divide: '\\frac', // TODO how to handle that properly? + dotMultiply: '.\\cdot', // TODO find ideal solution + dotDivide: '.:', // TODO find ideal solution + mod: '\\mod', + add: '+', + subtract: '-', + to: '\\rightarrow', + leftShift: '<<', + rightArithShift: '>>', + rightLogShift: '>>>', + equal: '=', + unequal: '\\neq', + smaller: '<', + larger: '>', + smallerEq: '\\leq', + largerEq: '\\geq', + bitAnd: '\\&', + bitXor: '\\underline{|}', + bitOr: '|', + and: '\\wedge', + xor: '\\veebar', + or: '\\vee' } export const latexFunctions = { @@ -289,7 +290,7 @@ const latexUnits = { } export function escapeLatex (string) { - return escapeLatexLib(string, { 'preserveFormatting': true }) + return escapeLatexLib(string, { preserveFormatting: true }) } // @param {string} name @@ -297,14 +298,14 @@ export function escapeLatex (string) { export function toSymbol (name, isUnit) { isUnit = typeof isUnit === 'undefined' ? false : isUnit if (isUnit) { - if (latexUnits.hasOwnProperty(name)) { + if (hasOwnProperty(latexUnits, name)) { return latexUnits[name] } return '\\mathrm{' + escapeLatex(name) + '}' } - if (latexSymbols.hasOwnProperty(name)) { + if (hasOwnProperty(latexSymbols, name)) { return latexSymbols[name] } diff --git a/src/utils/number.js b/src/utils/number.js index 6b4564b62..e65c03aaf 100644 --- a/src/utils/number.js +++ b/src/utils/number.js @@ -313,7 +313,7 @@ export function toEngineering (value, precision) { const rounded = roundDigits(splitNumber(value), precision) const e = rounded.exponent - let c = rounded.coefficients + const c = rounded.coefficients // find nearest lower multiple of 3 for exponent const newExp = e % 3 === 0 ? e : (e < 0 ? (e - 3) - (e % 3) : e - (e % 3)) diff --git a/src/utils/object.js b/src/utils/object.js index 0b8dd98ab..46cf4b3c7 100644 --- a/src/utils/object.js +++ b/src/utils/object.js @@ -171,7 +171,7 @@ export function deepFlatten (nestedObject) { // helper function used by deepFlatten function _deepFlatten (nestedObject, flattenedObject) { for (const prop in nestedObject) { - if (nestedObject.hasOwnProperty(prop)) { + if (hasOwnProperty(nestedObject, prop)) { const value = nestedObject[prop] if (typeof value === 'object' && value !== null) { _deepFlatten(value, flattenedObject) diff --git a/src/utils/product.js b/src/utils/product.js index 62ca48c41..d3e0fa5bd 100644 --- a/src/utils/product.js +++ b/src/utils/product.js @@ -3,13 +3,14 @@ * @returns {number} product of i to n */ export function product (i, n) { - let half if (n < i) { return 1 } + if (n === i) { return n } - half = (n + i) >> 1 // divide (n + i) by 2 and truncate to integer + + const half = (n + i) >> 1 // divide (n + i) by 2 and truncate to integer return product(i, half) * product(half + 1, n) } diff --git a/src/utils/snapshot.js b/src/utils/snapshot.js index 6e8804ade..d2d2d96eb 100644 --- a/src/utils/snapshot.js +++ b/src/utils/snapshot.js @@ -175,10 +175,10 @@ export function createSnapshotFromFactories (factories) { off: 'Function', once: 'Function', emit: 'Function', - 'import': 'Function', - 'var': 'Function', - 'eval': 'Function', - 'typeof': 'Function', + import: 'Function', + var: 'Function', + eval: 'Function', + typeof: 'Function', config: 'Function', create: 'Function', factory: 'Function', @@ -196,7 +196,7 @@ export function createSnapshotFromFactories (factories) { ...exclude(allFunctionsConstants, [ 'chain' ]), - 'config': 'Function' + config: 'Function' }, // deprecated stuff: // docs: embeddedDocs, @@ -241,11 +241,11 @@ export function createSnapshotFromFactories (factories) { deprecatedImport: 'Function', deprecatedVar: 'Function', deprecatedTypeof: 'Function', - '_true': 'boolean', - '_false': 'boolean', - '_null': 'null', - '_Infinity': 'number', - '_NaN': 'number', + _true: 'boolean', + _false: 'boolean', + _null: 'null', + _Infinity: 'number', + _NaN: 'number', ...allTypeChecks, ...allErrorClasses, diff --git a/src/utils/string.js b/src/utils/string.js index 5b11233e2..a862c9986 100644 --- a/src/utils/string.js +++ b/src/utils/string.js @@ -88,13 +88,9 @@ export function format (value, options) { // this object has a non-native toString method, use that one return value.toString() } else { - const entries = [] - - for (const key in value) { - if (value.hasOwnProperty(key)) { - entries.push('"' + key + '": ' + format(value[key], options)) - } - } + const entries = Object.keys(value).map(key => { + return '"' + key + '": ' + format(value[key], options) + }) return '{' + entries.join(', ') + '}' } diff --git a/test/benchmark/algebra.js b/test/benchmark/algebra.js index 5c1338f2c..7fd3bc243 100644 --- a/test/benchmark/algebra.js +++ b/test/benchmark/algebra.js @@ -16,7 +16,7 @@ console.log(' ' + math.simplify(simplifyExpr)) console.log('derivative ' + derivativeExpr) console.log(' ' + math.derivative(derivativeExpr, 'x')) -let results = [] +const results = [] const suite = new Benchmark.Suite() suite diff --git a/test/benchmark/expression_parser.js b/test/benchmark/expression_parser.js index 25ca1dee9..42ead94b6 100644 --- a/test/benchmark/expression_parser.js +++ b/test/benchmark/expression_parser.js @@ -18,7 +18,7 @@ function pad (text) { } const expr = '2 + 3 * sin(pi / 4) - 4x' -let scope = { x: 2 } +const scope = { x: 2 } const compiled = math.parse(expr).compile(math, {}) const sin = getSafeProperty(math, 'sin') @@ -39,7 +39,7 @@ assertApproxEqual(compiled.evaluate(scope), correctResult, 1e-7) assertApproxEqual(compiledPlainJs.evaluate(scope), correctResult, 1e-7) let total = 0 -let nodes = [] +const nodes = [] const suite = new Benchmark.Suite() suite diff --git a/test/node-tests/dist.test.js b/test/node-tests/dist.test.js index 249e400f0..141d6e0cf 100644 --- a/test/node-tests/dist.test.js +++ b/test/node-tests/dist.test.js @@ -71,31 +71,23 @@ describe('dist', function () { // test whether all functions are documented const missing = [] - for (let prop in math.expression.mathWithTransform) { - if (math.expression.mathWithTransform.hasOwnProperty(prop)) { - const obj = math[prop] - if (math['typeOf'](obj) !== 'Object') { - try { - if (ignore.indexOf(prop) === -1) { - math.help(prop).toString() - } - } catch (err) { - missing.push(prop) + Object.keys(math.expression.mathWithTransform).forEach(function (prop) { + const obj = math[prop] + if (math['typeOf'](obj) !== 'Object') { + try { + if (ignore.indexOf(prop) === -1) { + math.help(prop).toString() } + } catch (err) { + missing.push(prop) } } - } + }) // test whether there is documentation for non existing functions - const redundant = [] - const docs = math.docs - for (let prop in docs) { - if (docs.hasOwnProperty(prop)) { - if (math[prop] === undefined) { - redundant.push(prop) - } - } - } + const redundant = Object.keys(math.docs).filter(function (prop) { + return math[prop] === undefined + }) if (missing.length > 0 || redundant.length > 0) { let message = 'Validation failed: not all functions have embedded documentation. ' diff --git a/test/unit-tests/core/import.test.js b/test/unit-tests/core/import.test.js index 788581251..951a001d1 100644 --- a/test/unit-tests/core/import.test.js +++ b/test/unit-tests/core/import.test.js @@ -3,6 +3,7 @@ import mathjs from '../../../src/bundleAny' import approx from '../../../tools/approx' import { factory } from '../../../src/utils/factory' import { create } from '../../../src/core/create' +import { hasOwnProperty } from '../../../src/utils/object' const multiplyTestFactory = factory('multiplyTest', [], () => { return function multiply (a, b) { @@ -150,8 +151,8 @@ describe('import', function () { math.import({ bar: 456 }) - assert(!math.hasOwnProperty('foo')) - assert(math.hasOwnProperty('bar')) + assert(!hasOwnProperty(math, 'foo')) + assert(hasOwnProperty(math, 'bar')) delete Object.prototype.foo }) @@ -171,16 +172,16 @@ describe('import', function () { it('should merge typed functions with the same name', function () { math.import({ - 'foo': math.typed('foo', { - 'number': function (x) { + foo: math.typed('foo', { + number: function (x) { return 'foo(number)' } }) }) math.import({ - 'foo': math.typed('foo', { - 'string': function (x) { + foo: math.typed('foo', { + string: function (x) { return 'foo(string)' } }) @@ -196,8 +197,8 @@ describe('import', function () { it('should override existing typed functions', function () { math.import({ - 'foo': math.typed('foo', { - 'Date': function (x) { + foo: math.typed('foo', { + Date: function (x) { return 'foo(Date)' } }) @@ -206,8 +207,8 @@ describe('import', function () { assert.strictEqual(math.foo(new Date()), 'foo(Date)') math.import({ - 'foo': math.typed('foo', { - 'string': function (x) { + foo: math.typed('foo', { + string: function (x) { return 'foo(string)' } }) @@ -239,9 +240,9 @@ describe('import', function () { math.import({ foo: foo }) - assert(math.hasOwnProperty('foo')) + assert(hasOwnProperty(math, 'foo')) assert.strictEqual(math.foo, foo) - assert(math.expression.transform.hasOwnProperty('foo')) + assert(hasOwnProperty(math.expression.transform, 'foo')) assert.strictEqual(math.expression.transform.foo, foo.transform) }) @@ -252,7 +253,7 @@ describe('import', function () { math.import({ mean: mean }, { override: true }) - assert(math.hasOwnProperty('mean')) + assert(hasOwnProperty(math, 'mean')) assert.strictEqual(math.mean, mean) assert.strictEqual(math.expression.transform.mean, undefined) assert.strictEqual(math.expression.mathWithTransform.mean, mean) @@ -277,18 +278,18 @@ describe('import', function () { it('should merge typed functions coming from a legacy factory', function () { math.import({ - 'foo': math.typed('foo', { - 'number': function (x) { + foo: math.typed('foo', { + number: function (x) { return 'foo(number)' } }) }) math.import({ - 'name': 'foo', - 'factory': function () { + name: 'foo', + factory: function () { return math.typed('foo', { - 'string': function (x) { + string: function (x) { return 'foo(string)' } }) @@ -315,7 +316,7 @@ describe('import', function () { math.import([meanFactory], { override: true }) - assert(math.hasOwnProperty('mean')) + assert(hasOwnProperty(math, 'mean')) assert.strictEqual(math.mean, mean) assert.strictEqual(math.expression.transform.mean, undefined) assert.strictEqual(math.expression.mathWithTransform.mean, mean) @@ -357,7 +358,7 @@ describe('import', function () { assert.strictEqual(math2.multiplyTest, undefined) assert.strictEqual(math2.cubeTest, undefined) - math2.import([ multiplyTestFactory, cubeTestFactory ]) + math2.import([multiplyTestFactory, cubeTestFactory]) assert.strictEqual(math2.multiplyTest(2, 3), 6) assert.strictEqual(math2.cubeTest(3), 27) @@ -369,7 +370,7 @@ describe('import', function () { assert.strictEqual(math2.tools, undefined) assert.throws(() => { - math2.import([ nestedFactory ]) + math2.import([nestedFactory]) }, /Factory name should not contain a nested path/) }) @@ -380,7 +381,7 @@ describe('import', function () { assert.strictEqual(math2.cubeTest, undefined) // note that this depends on lazy loading - math2.import([ cubeTestFactory, multiplyTestFactory ]) + math2.import([cubeTestFactory, multiplyTestFactory]) assert.strictEqual(math2.multiplyTest(2, 3), 6) assert.strictEqual(math2.cubeTest(3), 27) diff --git a/test/unit-tests/expression/Help.test.js b/test/unit-tests/expression/Help.test.js index 927d96525..a8e326a04 100644 --- a/test/unit-tests/expression/Help.test.js +++ b/test/unit-tests/expression/Help.test.js @@ -7,18 +7,18 @@ const Help = math.Help describe('help', function () { const doc = { - 'name': 'add', - 'category': 'Operators', - 'syntax': [ + name: 'add', + category: 'Operators', + syntax: [ 'x + y', 'add(x, y)' ], - 'description': 'Add two values.', - 'examples': [ + description: 'Add two values.', + examples: [ 'a = 2.1 + 3.6', 'a - 3.6' ], - 'seealso': [ + seealso: [ 'subtract' ] } @@ -84,8 +84,8 @@ describe('help', function () { it('should stringify a doc with empty example', function () { const help = new Help({ - 'name': 'add', - 'examples': [ + name: 'add', + examples: [ '2 + 3', '' ] @@ -103,8 +103,8 @@ describe('help', function () { it('should stringify a doc with example throwing an error', function () { const help = new Help({ - 'name': 'add', - 'examples': [ + name: 'add', + examples: [ '2 ^^ 3' ] }) @@ -120,8 +120,8 @@ describe('help', function () { it('should return string representation on valueOf', function () { const help = new Help({ - 'name': 'add', - 'examples': [ + name: 'add', + examples: [ '2 ^^ 3' ] }) @@ -139,19 +139,19 @@ describe('help', function () { const help = new Help(doc) const json = help.toJSON() assert.deepStrictEqual(json, { - 'mathjs': 'Help', - 'name': 'add', - 'category': 'Operators', - 'syntax': [ + mathjs: 'Help', + name: 'add', + category: 'Operators', + syntax: [ 'x + y', 'add(x, y)' ], - 'description': 'Add two values.', - 'examples': [ + description: 'Add two values.', + examples: [ 'a = 2.1 + 3.6', 'a - 3.6' ], - 'seealso': [ + seealso: [ 'subtract' ] }) @@ -163,18 +163,18 @@ describe('help', function () { it('should instantiate Help from json using fromJSON', function () { const doc = { - 'name': 'add', - 'category': 'Operators', - 'syntax': [ + name: 'add', + category: 'Operators', + syntax: [ 'x + y', 'add(x, y)' ], - 'description': 'Add two values.', - 'examples': [ + description: 'Add two values.', + examples: [ 'a = 2.1 + 3.6', 'a - 3.6' ], - 'seealso': [ + seealso: [ 'subtract' ] } diff --git a/test/unit-tests/expression/function/evaluate.test.js b/test/unit-tests/expression/function/evaluate.test.js index a94ef3c44..4cc61407e 100644 --- a/test/unit-tests/expression/function/evaluate.test.js +++ b/test/unit-tests/expression/function/evaluate.test.js @@ -44,7 +44,7 @@ describe('evaluate', function () { }) it('should handle the given scope', function () { - let scope = { + const scope = { a: 3, b: 4 } diff --git a/test/unit-tests/expression/node/AccessorNode.test.js b/test/unit-tests/expression/node/AccessorNode.test.js index 1b3d208e0..e4caf7e81 100644 --- a/test/unit-tests/expression/node/AccessorNode.test.js +++ b/test/unit-tests/expression/node/AccessorNode.test.js @@ -52,7 +52,7 @@ describe('AccessorNode', function () { const n = new bigmath.AccessorNode(a, index) const expr = n.compile() - let scope = { + const scope = { a: [[1, 2], [3, 4]] } assert.strictEqual(expr.evaluate(scope), 3) @@ -70,7 +70,7 @@ describe('AccessorNode', function () { const n = new AccessorNode(a, index) const expr = n.compile() - let scope = { + const scope = { a: [[1, 2], [3, 4]] } assert.deepStrictEqual(expr.evaluate(scope), [[3, 4]]) @@ -82,7 +82,7 @@ describe('AccessorNode', function () { const n = new AccessorNode(a, index) const expr = n.compile() - let scope = { + const scope = { a: { b: 42 } } assert.deepStrictEqual(expr.evaluate(scope), 42) @@ -94,7 +94,7 @@ describe('AccessorNode', function () { const n = new AccessorNode(a, index) const expr = n.compile() - let scope = { + const scope = { a: [1, 2, 3] } assert.throws(function () { expr.evaluate(scope) }, /Index out of range \(4 > 3\)/) @@ -106,7 +106,7 @@ describe('AccessorNode', function () { const n = new AccessorNode(a, index) const expr = n.compile() - let scope = { + const scope = { a: math.matrix([1, 2, 3]) } assert.throws(function () { expr.evaluate(scope) }, /Index out of range \(4 > 3\)/) @@ -118,7 +118,7 @@ describe('AccessorNode', function () { const n = new AccessorNode(a, index) const expr = n.compile() - let scope = { + const scope = { a: 'hey' } assert.throws(function () { expr.evaluate(scope) }, /Index out of range \(4 > 3\)/) @@ -130,7 +130,7 @@ describe('AccessorNode', function () { const n = new AccessorNode(a, index) const expr = n.compile() - let scope = { + const scope = { a: {} } assert.throws(function () { expr.evaluate(scope) }, /Cannot apply a numeric index as object property/) @@ -142,7 +142,7 @@ describe('AccessorNode', function () { const n = new AccessorNode(a, index) const expr = n.compile() - let scope = { + const scope = { a: 42 } assert.throws(function () { expr.evaluate(scope) }, /Cannot apply index: unsupported type of object/) @@ -161,7 +161,7 @@ describe('AccessorNode', function () { const n = new AccessorNode(a, index) const expr = n.compile() - let scope = { + const scope = { a: [[1, 2], [3, 4]] } assert.deepStrictEqual(expr.evaluate(scope), [[4, 3]]) @@ -179,7 +179,7 @@ describe('AccessorNode', function () { const n = new AccessorNode(a, index) const expr = n.compile() - let scope = { + const scope = { a: [[1, 2], [3, 4]] } assert.deepStrictEqual(expr.evaluate(scope), [[3, 4]]) @@ -193,7 +193,7 @@ describe('AccessorNode', function () { new bigmath.IndexNode([b, c])) const expr = n.compile() - let scope = { + const scope = { a: [[1, 2], [3, 4]] } assert.deepStrictEqual(expr.evaluate(scope), 3) diff --git a/test/unit-tests/expression/node/ArrayNode.test.js b/test/unit-tests/expression/node/ArrayNode.test.js index 816efcfb5..c20fc9a07 100644 --- a/test/unit-tests/expression/node/ArrayNode.test.js +++ b/test/unit-tests/expression/node/ArrayNode.test.js @@ -284,7 +284,7 @@ describe('ArrayNode', function () { assert.deepStrictEqual(json, { mathjs: 'ArrayNode', - items: [ b, c ] + items: [b, c] }) const parsed = ArrayNode.fromJSON(json) diff --git a/test/unit-tests/expression/node/AssignmentNode.test.js b/test/unit-tests/expression/node/AssignmentNode.test.js index f2ba03944..e82765c5a 100644 --- a/test/unit-tests/expression/node/AssignmentNode.test.js +++ b/test/unit-tests/expression/node/AssignmentNode.test.js @@ -62,7 +62,7 @@ describe('AssignmentNode', function () { const expr = n.compile() - let scope = {} + const scope = {} assert.strictEqual(expr.evaluate(scope), 3) assert.strictEqual(scope.b, 3) }) @@ -75,7 +75,7 @@ describe('AssignmentNode', function () { const expr = n.compile() - let scope = { + const scope = { a: {} } assert.strictEqual(expr.evaluate(scope), 3) @@ -91,7 +91,7 @@ describe('AssignmentNode', function () { const expr = n.compile() - let scope = { + const scope = { a: { b: {} } @@ -110,7 +110,7 @@ describe('AssignmentNode', function () { const n = new AssignmentNode(object, index, value) const expr = n.compile() - let scope = { + const scope = { a: [[0, 0], [0, 0]] } assert.strictEqual(expr.evaluate(scope), 5) @@ -132,7 +132,7 @@ describe('AssignmentNode', function () { const n = new AssignmentNode(object, index, value) const expr = n.compile() - let scope = { + const scope = { a: [[0, 0], [0, 0]], b: [5, 6] } @@ -155,7 +155,7 @@ describe('AssignmentNode', function () { const n = new bigmath.AssignmentNode(object, index, value) const expr = n.compile() - let scope = { + const scope = { a: [[0, 0], [0, 0]] } assert.deepStrictEqual(expr.evaluate(scope), bigmath.bignumber(5)) @@ -171,7 +171,7 @@ describe('AssignmentNode', function () { const n = new AssignmentNode(a, index, value) const expr = n.compile() - let scope = { + const scope = { a: 42 } assert.throws(function () { expr.evaluate(scope) }, /Cannot apply index: unsupported type of object/) diff --git a/test/unit-tests/expression/node/BlockNode.test.js b/test/unit-tests/expression/node/BlockNode.test.js index f2c7b043b..c6de5c7b4 100644 --- a/test/unit-tests/expression/node/BlockNode.test.js +++ b/test/unit-tests/expression/node/BlockNode.test.js @@ -51,7 +51,7 @@ describe('BlockNode', function () { } ]) - let scope = {} + const scope = {} assert.deepStrictEqual(n.compile().evaluate(scope), new ResultSet([5, 3])) assert.deepStrictEqual(scope, { foo: 3 }) }) @@ -244,11 +244,11 @@ describe('BlockNode', function () { }) it('test equality another Node', function () { - const a = new BlockNode([ { node: new SymbolNode('x') }, { node: new ConstantNode(2) } ]) - const b = new BlockNode([ { node: new SymbolNode('x') }, { node: new ConstantNode(2) } ]) - const c = new BlockNode([ { node: new SymbolNode('x') }, { node: new ConstantNode(4) } ]) - const d = new BlockNode([ { node: new SymbolNode('x') }, { node: new ConstantNode(2), visible: false } ]) - const e = new BlockNode([ { node: new SymbolNode('x') }, { node: new ConstantNode(2) }, { node: new ConstantNode(5) } ]) + const a = new BlockNode([{ node: new SymbolNode('x') }, { node: new ConstantNode(2) }]) + const b = new BlockNode([{ node: new SymbolNode('x') }, { node: new ConstantNode(2) }]) + const c = new BlockNode([{ node: new SymbolNode('x') }, { node: new ConstantNode(4) }]) + const d = new BlockNode([{ node: new SymbolNode('x') }, { node: new ConstantNode(2), visible: false }]) + const e = new BlockNode([{ node: new SymbolNode('x') }, { node: new ConstantNode(2) }, { node: new ConstantNode(5) }]) assert.strictEqual(a.equals(null), false) assert.strictEqual(a.equals(undefined), false) @@ -304,7 +304,7 @@ describe('BlockNode', function () { assert.deepStrictEqual(json, { mathjs: 'BlockNode', - blocks: [ bBlock, cBlock ] + blocks: [bBlock, cBlock] }) const parsed = BlockNode.fromJSON(json) diff --git a/test/unit-tests/expression/node/ConditionalNode.test.js b/test/unit-tests/expression/node/ConditionalNode.test.js index dfa02434e..c5955470c 100644 --- a/test/unit-tests/expression/node/ConditionalNode.test.js +++ b/test/unit-tests/expression/node/ConditionalNode.test.js @@ -43,7 +43,7 @@ describe('ConditionalNode', function () { it('should lazy evaluate a ConditionalNode', function () { const n = new ConditionalNode(condition, a, b) const expr = n.compile() - let scope = {} + const scope = {} assert.strictEqual(expr.evaluate(scope), 2) assert.deepStrictEqual(scope, { a: 2 }) }) diff --git a/test/unit-tests/expression/node/FunctionAssignmentNode.test.js b/test/unit-tests/expression/node/FunctionAssignmentNode.test.js index aaa09e26c..336bd13b8 100644 --- a/test/unit-tests/expression/node/FunctionAssignmentNode.test.js +++ b/test/unit-tests/expression/node/FunctionAssignmentNode.test.js @@ -43,7 +43,7 @@ describe('FunctionAssignmentNode', function () { const n = new FunctionAssignmentNode('f', ['x'], o) const expr = n.compile() - let scope = {} + const scope = {} expr.evaluate(scope) assert.strictEqual(typeof scope.f, 'function') assert.strictEqual(scope.f(3), 5) @@ -57,7 +57,7 @@ describe('FunctionAssignmentNode', function () { const n = new FunctionAssignmentNode('f', [{ name: 'x', type: 'number' }], o) const expr = n.compile() - let scope = {} + const scope = {} expr.evaluate(scope) assert.strictEqual(typeof scope.f, 'function') assert.strictEqual(scope.f(3), 5) @@ -86,7 +86,7 @@ describe('FunctionAssignmentNode', function () { const n2 = new FunctionAssignmentNode('factorial', ['x'], n1) const expr = n2.compile() - let scope = {} + const scope = {} const factorial = expr.evaluate(scope) assert.strictEqual(typeof scope.factorial, 'function') assert.strictEqual(factorial(3), 6) @@ -107,10 +107,10 @@ describe('FunctionAssignmentNode', function () { one, new OperatorNode('+', 'add', [ new FunctionNode(new SymbolNode('fib'), [ - new OperatorNode('-', 'subtract', [ x, one ]) + new OperatorNode('-', 'subtract', [x, one]) ]), new FunctionNode(new SymbolNode('fib'), [ - new OperatorNode('-', 'subtract', [ x, two ]) + new OperatorNode('-', 'subtract', [x, two]) ]) ]) ) @@ -120,7 +120,7 @@ describe('FunctionAssignmentNode', function () { // const n2 = math.parse('fib(x) = (x <= 0) ? 0 : ((x <= 2) ? 1 : (fib(x - 1) + f(fib - 2)))'); const expr = n2.compile() - let scope = {} + const scope = {} const fib = expr.evaluate(scope) assert.strictEqual(typeof fib, 'function') @@ -147,7 +147,7 @@ describe('FunctionAssignmentNode', function () { const o = new FunctionNode('outputScope', [x]) const n = new FunctionAssignmentNode('f', ['x'], o) - let scope = { a: 2 } + const scope = { a: 2 } const f = n.evaluate(scope) assert.deepStrictEqual(f(3), { a: 2, f: f, x: 3 }) }) @@ -172,7 +172,7 @@ describe('FunctionAssignmentNode', function () { const b = new FunctionNode(a, [new SymbolNode('y')]) const n = new FunctionAssignmentNode('f', ['x', 'y'], b) - let scope = { a: 2 } + const scope = { a: 2 } const f = n.evaluate(scope) assert.deepStrictEqual(f(3, 4), { a: 2, f, x: 3, y: 4 }) }) @@ -192,7 +192,7 @@ describe('FunctionAssignmentNode', function () { const o = new FunctionNode('outputScope', [x]) const n = new FunctionAssignmentNode('f', ['x'], o) - let scope = { a: 2 } + const scope = { a: 2 } const f = n.evaluate(scope) assert.deepStrictEqual(f(3), { a: 2, f, x: 3 }) }) diff --git a/test/unit-tests/expression/node/FunctionNode.test.js b/test/unit-tests/expression/node/FunctionNode.test.js index 3df51eb43..137ba9276 100644 --- a/test/unit-tests/expression/node/FunctionNode.test.js +++ b/test/unit-tests/expression/node/FunctionNode.test.js @@ -58,7 +58,7 @@ describe('FunctionNode', function () { const c = new ConstantNode(4) const n = new FunctionNode(s, [c]) - let scope = {} + const scope = {} assert.strictEqual(n.compile().evaluate(scope), 2) }) @@ -70,7 +70,7 @@ describe('FunctionNode', function () { const c = new ConstantNode(4) const n = new FunctionNode(a, [c]) - let scope = { + const scope = { foo: { bar: function (x) { return x * x @@ -87,7 +87,7 @@ describe('FunctionNode', function () { const c = new ConstantNode(4) const n = new FunctionNode(a, [c]) - let scope = { + const scope = { foo: { count: 42, getCount: function () { @@ -115,14 +115,14 @@ describe('FunctionNode', function () { const b = new mymath.ConstantNode(5) const n = new mymath.FunctionNode(s, [a, b]) - let scope = { + const scope = { foo: 'bar' } assert.strictEqual(n.compile().evaluate(scope), 'myFunction(4, 5)') }) it('should compile a FunctionNode containing an index resolving to a function with rawArgs', function () { - let scope = { + const scope = { obj: {} } @@ -162,7 +162,7 @@ describe('FunctionNode', function () { const b = new mymath.ConstantNode(5) const n = new mymath.FunctionNode(s, [a, b]) - let scope = { + const scope = { myFunction: function () { return 42 } @@ -434,7 +434,7 @@ describe('FunctionNode', function () { it('should stringify a FunctionNode with custom toString for a single function', function () { // Also checks if the custom functions get passed on to the children const customFunction = { - 'add': function (node, options) { + add: function (node, options) { return node.args[0].toString(options) + ' ' + node.name + ' ' + node.args[1].toString(options) @@ -519,7 +519,7 @@ describe('FunctionNode', function () { it('should LaTeX a FunctionNode with custom toTex for a single function', function () { // Also checks if the custom functions get passed on to the children const customFunction = { - 'add': function (node, options) { + add: function (node, options) { return node.args[0].toTex(options) + ' ' + node.name + ' ' + node.args[1].toTex(options) diff --git a/test/unit-tests/expression/node/IndexNode.test.js b/test/unit-tests/expression/node/IndexNode.test.js index a167a46d3..d85f1982c 100644 --- a/test/unit-tests/expression/node/IndexNode.test.js +++ b/test/unit-tests/expression/node/IndexNode.test.js @@ -214,7 +214,7 @@ describe('IndexNode', function () { assert.deepStrictEqual(json, { mathjs: 'IndexNode', - dimensions: [ prop ], + dimensions: [prop], dotNotation: true }) diff --git a/test/unit-tests/expression/node/OperatorNode.test.js b/test/unit-tests/expression/node/OperatorNode.test.js index 8bc48a97f..02e437914 100644 --- a/test/unit-tests/expression/node/OperatorNode.test.js +++ b/test/unit-tests/expression/node/OperatorNode.test.js @@ -716,7 +716,7 @@ describe('OperatorNode', function () { mathjs: 'OperatorNode', op: '+', fn: 'add', - args: [ b, c ], + args: [b, c], implicit: true }) diff --git a/test/unit-tests/expression/node/RelationalNode.test.js b/test/unit-tests/expression/node/RelationalNode.test.js index 5946c6bf4..16eb31fce 100644 --- a/test/unit-tests/expression/node/RelationalNode.test.js +++ b/test/unit-tests/expression/node/RelationalNode.test.js @@ -40,7 +40,7 @@ describe('RelationalNode', function () { it('should evaluate a RelationalNode', function () { let n = new RelationalNode(['smaller', 'smaller'], [one, two, three]) let expr = n.compile() - let scope = {} + const scope = {} assert.strictEqual(expr.evaluate(scope), true) n = new RelationalNode(['smaller', 'smaller'], [three, two, one]) @@ -49,7 +49,7 @@ describe('RelationalNode', function () { }) it('should filter a RelationalNode', function () { - let n = new RelationalNode(['smaller', 'smaller'], [one, two, three]) + const n = new RelationalNode(['smaller', 'smaller'], [one, two, three]) assert.deepStrictEqual(n.filter(function (node) { return node instanceof RelationalNode }), [n]) assert.deepStrictEqual(n.filter(function (node) { return node instanceof ConstantNode }), [one, two, three]) @@ -164,7 +164,7 @@ describe('RelationalNode', function () { it('should perform short-circuit evaluation', function () { const n = math.parse('(a = a+1) > (b = b+1) > (c = c+1) > (d = d+1)') const scope = { a: 0, b: 0, c: 0, d: 0 } - let result = n.evaluate(scope) + const result = n.evaluate(scope) assert.strictEqual(scope.a, 1) assert.strictEqual(scope.b, 1) assert.strictEqual(scope.c, 0) @@ -175,7 +175,7 @@ describe('RelationalNode', function () { it('should not evaluate params more than once', function () { const n = math.parse('(a = a+1) >= (b = b+1) >= (c = c+1) >= (d = d+1)') const scope = { a: 0, b: 0, c: 0, d: 0 } - let result = n.evaluate(scope) + const result = n.evaluate(scope) assert.strictEqual(scope.a, 1) assert.strictEqual(scope.b, 1) assert.strictEqual(scope.c, 1) diff --git a/test/unit-tests/expression/node/SymbolNode.test.js b/test/unit-tests/expression/node/SymbolNode.test.js index dec9de5fe..f742cabae 100644 --- a/test/unit-tests/expression/node/SymbolNode.test.js +++ b/test/unit-tests/expression/node/SymbolNode.test.js @@ -30,7 +30,7 @@ describe('SymbolNode', function () { }) it('should throw an error when evaluating an undefined symbol', function () { - let scope = {} + const scope = {} const s = new SymbolNode('foo') assert.throws(function () { s.compile().evaluate(scope) }, Error) }) @@ -39,13 +39,13 @@ describe('SymbolNode', function () { const s = new SymbolNode('a') const expr = s.compile() - let scope = { a: 5 } + const scope = { a: 5 } assert.strictEqual(expr.evaluate(scope), 5) assert.throws(function () { expr.evaluate({}) }, Error) const s2 = new SymbolNode('sqrt') const expr2 = s2.compile() - let scope2 = {} + const scope2 = {} assert.strictEqual(expr2.evaluate(scope2), math.sqrt) }) diff --git a/test/unit-tests/expression/parse.test.js b/test/unit-tests/expression/parse.test.js index ab45b64dd..0e3466a05 100644 --- a/test/unit-tests/expression/parse.test.js +++ b/test/unit-tests/expression/parse.test.js @@ -44,14 +44,14 @@ describe('parse', function () { }) it('should parse an array with expressions', function () { - let scope = {} + const scope = {} assert.deepStrictEqual(parse(['a=3', 'b=4', 'a*b']).map(function (node) { return node.compile().evaluate(scope) }), [3, 4, 12]) }) it('should parse a matrix with expressions', function () { - let scope = {} + const scope = {} assert.deepStrictEqual(parse(math.matrix(['a=3', 'b=4', 'a*b'])).map(function (node) { return node.compile().evaluate(scope) }), math.matrix([3, 4, 12])) @@ -71,7 +71,7 @@ describe('parse', function () { it('should parse unicode and other special characters', function () { // https://unicode-table.com/en - let scope = {} + const scope = {} math.evaluate('$ab$c = 2', scope) // dollar sign assert.strictEqual(scope['$ab$c'], 2) @@ -121,19 +121,19 @@ describe('parse', function () { }) it('should parse multiple function assignments', function () { - let scope = {} + const scope = {} parse('f(x)=x*2;g(x)=x*3').compile().evaluate(scope) assert.strictEqual(scope.f(2), 4) assert.strictEqual(scope.g(2), 6) - let scope2 = {} + const scope2 = {} parse('a=2;f(x)=x^a;').compile().evaluate(scope2) assert.strictEqual(scope2.a, 2) assert.strictEqual(scope2.f(3), 9) }) it('should correctly scope a function variable if also used outside the function', function () { - let scope = {} + const scope = {} const res = parse('x=2;f(x)=x^2;x').compile().evaluate(scope) // x should be x=2, not x of the function assert.deepStrictEqual(res.entries, [2]) @@ -169,14 +169,14 @@ describe('parse', function () { it('should spread an index over multiple lines', function () { assert.deepStrictEqual(parse('a[\n1\n,\n1\n]').compile().evaluate({ a: [[1, 2], [3, 4]] }), 1) - let scope = { a: [[1, 2], [3, 4]] } + const scope = { a: [[1, 2], [3, 4]] } assert.deepStrictEqual(parse('a[\n1\n,\n1\n]=\n100').compile().evaluate(scope), 100) assert.deepStrictEqual(scope, { a: [[100, 2], [3, 4]] }) }) }) it('should throw an error when scope contains a reserved keyword', function () { - let scope = { + const scope = { end: 2 } assert.throws(function () { @@ -316,7 +316,7 @@ describe('parse', function () { }) it('should get a string subset', function () { - let scope = {} + const scope = {} assert.deepStrictEqual(parseAndEval('c="hello"', scope), 'hello') assert.deepStrictEqual(parseAndEval('c[2:4]', scope), 'ell') assert.deepStrictEqual(parseAndEval('c[5:-1:1]', scope), 'olleh') @@ -325,7 +325,7 @@ describe('parse', function () { }) it('should set a string subset', function () { - let scope = {} + const scope = {} assert.deepStrictEqual(parseAndEval('c="hello"', scope), 'hello') assert.deepStrictEqual(parseAndEval('c[1] = "H"', scope), 'H') assert.deepStrictEqual(scope.c, 'Hello') @@ -337,7 +337,7 @@ describe('parse', function () { }) it('should set a string subset on an object', function () { - let scope = { a: {} } + const scope = { a: {} } assert.deepStrictEqual(parseAndEval('a.c="hello"', scope), 'hello') assert.deepStrictEqual(parseAndEval('a.c[1] = "H"', scope), 'H') assert.deepStrictEqual(scope.a, { c: 'Hello' }) @@ -372,7 +372,7 @@ describe('parse', function () { }) it('should get a string subset', function () { - let scope = {} + const scope = {} assert.deepStrictEqual(parseAndEval('c=\'hello\'', scope), 'hello') assert.deepStrictEqual(parseAndEval('c[2:4]', scope), 'ell') assert.deepStrictEqual(parseAndEval('c[5:-1:1]', scope), 'olleh') @@ -381,7 +381,7 @@ describe('parse', function () { }) it('should set a string subset', function () { - let scope = {} + const scope = {} assert.deepStrictEqual(parseAndEval('c=\'hello\'', scope), 'hello') assert.deepStrictEqual(parseAndEval('c[1] = \'H\'', scope), 'H') assert.deepStrictEqual(scope.c, 'Hello') @@ -393,7 +393,7 @@ describe('parse', function () { }) it('should set a string subset on an object', function () { - let scope = { a: {} } + const scope = { a: {} } assert.deepStrictEqual(parseAndEval('a.c=\'hello\'', scope), 'hello') assert.deepStrictEqual(parseAndEval('a.c[1] = \'H\'', scope), 'H') assert.deepStrictEqual(scope.a, { c: 'Hello' }) @@ -427,7 +427,7 @@ describe('parse', function () { }) it('should convert units', function () { - let scope = {} + const scope = {} approx.deepEqual(parseAndEval('(5.08 cm * 1000) to inch', scope), math.unit(2000, 'inch').to('inch')) approx.deepEqual(parseAndEval('a = (5.08 cm * 1000) to mm', scope), @@ -508,7 +508,7 @@ describe('parse', function () { }) it('should get a matrix subset', function () { - let scope = { + const scope = { a: math.matrix([ [1, 2, 3], [4, 5, 6], @@ -530,7 +530,7 @@ describe('parse', function () { }) it('should get a matrix subset of a matrix subset', function () { - let scope = { + const scope = { a: math.matrix([ [1, 2, 3], [4, 5, 6], @@ -546,7 +546,7 @@ describe('parse', function () { }) it('should parse matrix resizings', function () { - let scope = {} + const scope = {} assert.deepStrictEqual(parseAndEval('a = []', scope), math.matrix([])) assert.deepStrictEqual(parseAndEval('a[1:3,1] = [1;2;3]', scope), math.matrix([[1], [2], [3]])) assert.deepStrictEqual(parseAndEval('a[:,2] = [4;5;6]', scope), math.matrix([[4], [5], [6]])) @@ -572,7 +572,7 @@ describe('parse', function () { }) it('should get/set the matrix correctly', function () { - let scope = {} + const scope = {} parseAndEval('a=[1,2;3,4]', scope) parseAndEval('a[1,1] = 100', scope) assert.deepStrictEqual(scope.a.size(), [2, 2]) @@ -590,7 +590,7 @@ describe('parse', function () { }) it('should get/set the matrix correctly for 3d matrices', function () { - let scope = {} + const scope = {} assert.deepStrictEqual(parseAndEval('f=[1,2;3,4]', scope), math.matrix([[1, 2], [3, 4]])) assert.deepStrictEqual(parseAndEval('size(f)', scope), math.matrix([2, 2])) @@ -625,12 +625,12 @@ describe('parse', function () { }) it('should merge nested matrices', function () { - let scope = {} + const scope = {} parseAndEval('a=[1,2;3,4]', scope) }) it('should parse matrix concatenations', function () { - let scope = {} + const scope = {} parseAndEval('a=[1,2;3,4]', scope) parseAndEval('b=[5,6;7,8]', scope) assert.deepStrictEqual(parseAndEval('c=concat(a,b)', scope), math.matrix([[1, 2, 5, 6], [3, 4, 7, 8]])) @@ -650,7 +650,7 @@ describe('parse', function () { }) it('should disable arrays as range in a matrix index', function () { - let scope = { + const scope = { a: [[1, 2, 3], [4, 5, 6]] } @@ -669,12 +669,12 @@ describe('parse', function () { }) it('should throw an error for invalid matrix subsets', function () { - let scope = { a: [1, 2, 3] } + const scope = { a: [1, 2, 3] } assert.throws(function () { parseAndEval('a[1', scope) }, /Parenthesis ] expected/) }) it('should throw an error for invalid matrix concatenations', function () { - let scope = {} + const scope = {} assert.throws(function () { parseAndEval('c=concat(a, [1,2,3])', scope) }) }) }) @@ -697,28 +697,28 @@ describe('parse', function () { }) it('should set an object property', function () { - let scope = { obj: { a: 3 } } + const scope = { obj: { a: 3 } } const res = parseAndEval('obj["b"] = 2', scope) assert.strictEqual(res, 2) assert.deepStrictEqual(scope, { obj: { a: 3, b: 2 } }) }) it('should set a nested object property', function () { - let scope = { obj: { foo: {} } } + const scope = { obj: { foo: {} } } const res = parseAndEval('obj["foo"]["bar"] = 2', scope) assert.strictEqual(res, 2) assert.deepStrictEqual(scope, { obj: { foo: { bar: 2 } } }) }) it('should throw an error when trying to apply a matrix index as object property', function () { - let scope = { a: {} } + const scope = { a: {} } assert.throws(function () { parseAndEval('a[2] = 6', scope) }, /Cannot apply a numeric index as object property/) }) it('should set a nested matrix subset from an object property (1)', function () { - let scope = { obj: { foo: [1, 2, 3] } } + const scope = { obj: { foo: [1, 2, 3] } } assert.deepStrictEqual(parseAndEval('obj.foo[2] = 6', scope), 6) assert.deepStrictEqual(scope, { obj: { foo: [1, 6, 3] } }) @@ -727,19 +727,19 @@ describe('parse', function () { }) it('should set a nested matrix subset from an object property (2)', function () { - let scope = { obj: { foo: [{ bar: 4 }] } } + const scope = { obj: { foo: [{ bar: 4 }] } } assert.deepStrictEqual(parseAndEval('obj.foo[1].bar = 6', scope), 6) assert.deepStrictEqual(scope, { obj: { foo: [{ bar: 6 }] } }) }) it('should set a nested matrix subset from an object property (3)', function () { - let scope = { obj: { foo: [{ bar: {} }] } } + const scope = { obj: { foo: [{ bar: {} }] } } assert.deepStrictEqual(parseAndEval('obj.foo[1].bar.baz = 6', scope), 6) assert.deepStrictEqual(scope, { obj: { foo: [{ bar: { baz: 6 } }] } }) }) it('should set a nested matrix subset from an object property (4)', function () { - let scope = { obj: { foo: ['hello', 'world'] } } + const scope = { obj: { foo: ['hello', 'world'] } } assert.deepStrictEqual(parseAndEval('obj.foo[1][end] = "a"', scope), 'a') assert.deepStrictEqual(scope, { obj: { foo: ['hella', 'world'] } }) assert.deepStrictEqual(parseAndEval('obj.foo[end][end] = "!"', scope), '!') @@ -761,7 +761,7 @@ describe('parse', function () { }) it('should invoke a function in an object', function () { - let scope = { + const scope = { obj: { fn: function (x) { return x * x @@ -794,13 +794,13 @@ describe('parse', function () { }) it('should set an object property with dot notation', function () { - let scope = { obj: {} } + const scope = { obj: {} } parseAndEval('obj.foo = 2', scope) assert.deepStrictEqual(scope, { obj: { foo: 2 } }) }) it('should set a nested object property with dot notation', function () { - let scope = { obj: { foo: {} } } + const scope = { obj: { foo: {} } } parseAndEval('obj.foo.bar = 2', scope) assert.deepStrictEqual(scope, { obj: { foo: { bar: 2 } } }) }) @@ -842,13 +842,13 @@ describe('parse', function () { it('should not parse a function assignment in an accessor node', function () { assert.throws(function () { - let scope = {} + const scope = {} parseAndEval('a["b"](x)=x^2', scope) }, /SyntaxError: Invalid left hand side of assignment operator =/) }) it('should parse an object containing a variable assignment', function () { - let scope = {} + const scope = {} assert.deepStrictEqual(parseAndEval('{f: a=42}', scope), { f: 42 }) assert.strictEqual(scope.a, 42) }) @@ -913,7 +913,7 @@ describe('parse', function () { describe('variables', function () { it('should parse valid variable assignments', function () { - let scope = {} + const scope = {} assert.strictEqual(parseAndEval('a = 0.75', scope), 0.75) assert.strictEqual(parseAndEval('a + 2', scope), 2.75) assert.strictEqual(parseAndEval('a = 2', scope), 2) @@ -931,7 +931,7 @@ describe('parse', function () { }) it('should parse nested assignments', function () { - let scope = {} + const scope = {} assert.strictEqual(parseAndEval('c = d = (e = 4.5)', scope), 4.5) assert.strictEqual(scope.c, 4.5) assert.strictEqual(scope.d, 4.5) @@ -943,13 +943,13 @@ describe('parse', function () { }) it('should parse variable assignment inside a function call', function () { - let scope = {} + const scope = {} assert.deepStrictEqual(parseAndEval('sqrt(x=4)', scope), 2) assert.deepStrictEqual(scope, { x: 4 }) }) it('should parse variable assignment inside an accessor', function () { - let scope = { A: [10, 20, 30] } + const scope = { A: [10, 20, 30] } assert.deepStrictEqual(parseAndEval('A[x=2]', scope), 20) assert.deepStrictEqual(scope, { A: [10, 20, 30], x: 2 }) }) @@ -968,7 +968,7 @@ describe('parse', function () { }) it('should get a subset of a matrix returned by a function', function () { - let scope = { + const scope = { test: function () { return [1, 2, 3, 4] } @@ -986,7 +986,7 @@ describe('parse', function () { ] const m = math.matrix(a) const c = math.matrix([[2], [1], [0], [4], [0]]) - let scope = { + const scope = { test: function () { return m } @@ -1004,7 +1004,7 @@ describe('parse', function () { ] const m = math.matrix(a) const r = math.matrix([[0, 1, 0, 2, 4]]) - let scope = { + const scope = { test: function () { return m } @@ -1017,7 +1017,7 @@ describe('parse', function () { }) it('should parse function assignments', function () { - let scope = {} + const scope = {} parseAndEval('x=100', scope) // for testing scoping of the function variables assert.strictEqual(parseAndEval('f(x) = x^2', scope).syntax, 'f(x)') assert.strictEqual(parseAndEval('f(3)', scope), 9) @@ -1029,7 +1029,7 @@ describe('parse', function () { }) it('should correctly evaluate variables in assigned functions', function () { - let scope = {} + const scope = {} assert.strictEqual(parseAndEval('a = 3', scope), 3) assert.strictEqual(parseAndEval('f(x) = a * x', scope).syntax, 'f(x)') assert.strictEqual(parseAndEval('f(2)', scope), 6) @@ -1041,7 +1041,7 @@ describe('parse', function () { }) it('should throw an error for undefined variables in an assigned function', function () { - let scope = {} + const scope = {} assert.strictEqual(parseAndEval('g(x) = x^q', scope).syntax, 'g(x)') assert.throws(function () { parseAndEval('g(3)', scope) @@ -1052,12 +1052,12 @@ describe('parse', function () { it('should throw an error on invalid left hand side of a function assignment', function () { assert.throws(function () { - let scope = {} + const scope = {} parseAndEval('g(x, 2) = x^2', scope) }, SyntaxError) assert.throws(function () { - let scope = {} + const scope = {} parseAndEval('2(x, 2) = x^2', scope) }, SyntaxError) }) @@ -1495,7 +1495,7 @@ describe('parse', function () { }) it('should lazily evaluate conditional expression a ? b : c', function () { - let scope = {} + const scope = {} math.parse('true ? (a = 2) : (b = 2)').compile().evaluate(scope) assert.deepStrictEqual(scope, { a: 2 }) }) @@ -1775,7 +1775,7 @@ describe('parse', function () { }) it('should evaluate function "sort" with a custom sort function', function () { - let scope = {} + const scope = {} parseAndEval('sortByLength(a, b) = size(a)[1] - size(b)[1]', scope) assert.deepStrictEqual(parseAndEval('sort(["Langdon", "Tom", "Sara"], sortByLength)', scope), math.matrix(['Tom', 'Sara', 'Langdon'])) @@ -1823,7 +1823,7 @@ describe('parse', function () { }) it('should get an element from a matrix with bignumbers', function () { - let scope = {} + const scope = {} assert.deepStrictEqual(bigmath.evaluate('a=[0.1, 0.2]', scope), bigmath.matrix([new BigNumber(0.1), new BigNumber(0.2)])) @@ -1835,7 +1835,7 @@ describe('parse', function () { }) it('should replace elements in a matrix with bignumbers', function () { - let scope = {} + const scope = {} assert.deepStrictEqual(bigmath.evaluate('a=[0.1, 0.2]', scope), bigmath.matrix([new BigNumber(0.1), new BigNumber(0.2)])) @@ -1860,7 +1860,7 @@ describe('parse', function () { describe('scope', function () { it('should use a given scope for assignments', function () { - let scope = { + const scope = { a: 3, b: 4 } @@ -1884,7 +1884,7 @@ describe('parse', function () { }) it('should parse undefined symbols, defining symbols, and removing symbols', function () { - let scope = {} + const scope = {} let n = parse('q') assert.throws(function () { n.compile().evaluate(scope) }) parse('q=33').compile().evaluate(scope) diff --git a/test/unit-tests/expression/security.test.js b/test/unit-tests/expression/security.test.js index 021401f58..1199f1aea 100644 --- a/test/unit-tests/expression/security.test.js +++ b/test/unit-tests/expression/security.test.js @@ -84,7 +84,7 @@ describe('security', function () { }) it('should not allow disguising forbidden properties with unicode characters', function () { - let scope = { + const scope = { a: {} } diff --git a/test/unit-tests/expression/transform/std.transform.test.js b/test/unit-tests/expression/transform/std.transform.test.js index 4e3064573..d2e905fc8 100644 --- a/test/unit-tests/expression/transform/std.transform.test.js +++ b/test/unit-tests/expression/transform/std.transform.test.js @@ -6,10 +6,10 @@ const std = math.expression.transform.std describe('std', function () { const inputMatrix = [ // this is a 4x3x2 matrix, full test coverage - [ [10, 200], [30, 40], [50, 60] ], - [ [70, 80], [90, 100], [180, 120] ], - [ [130, 140], [160, 150], [170, 110] ], - [ [190, 20], [210, 220], [230, 240] ] + [[10, 200], [30, 40], [50, 60]], + [[70, 80], [90, 100], [180, 120]], + [[130, 140], [160, 150], [170, 110]], + [[190, 20], [210, 220], [230, 240]] ] it('should return the standard deviation value along a dimension on a matrix with one based indicies', function () { diff --git a/test/unit-tests/expression/transform/variance.transform.test.js b/test/unit-tests/expression/transform/variance.transform.test.js index 3954f92ba..73d41ee62 100644 --- a/test/unit-tests/expression/transform/variance.transform.test.js +++ b/test/unit-tests/expression/transform/variance.transform.test.js @@ -6,10 +6,10 @@ const variance = math.expression.transform.variance describe('variance', function () { const inputMatrix = [ // this is a 4x3x2 matrix, full test coverage - [ [10, 200], [30, 40], [50, 60] ], - [ [70, 80], [90, 100], [180, 120] ], - [ [130, 140], [160, 150], [170, 110] ], - [ [190, 20], [210, 220], [230, 240] ] + [[10, 200], [30, 40], [50, 60]], + [[70, 80], [90, 100], [180, 120]], + [[130, 140], [160, 150], [170, 110]], + [[190, 20], [210, 220], [230, 240]] ] it('should return the variance value along a dimension on a matrix with one based indicies', function () { diff --git a/test/unit-tests/expression/transforms.test.js b/test/unit-tests/expression/transforms.test.js index 2ddae80bc..868985567 100644 --- a/test/unit-tests/expression/transforms.test.js +++ b/test/unit-tests/expression/transforms.test.js @@ -8,7 +8,7 @@ describe('transforms', function () { describe('filter', function () { it('should execute filter on an array with one based indices', function () { const logs = [] - let scope = { + const scope = { A: [1, 2, 3], callback: function (value, index, matrix) { assert.strictEqual(matrix, scope.A) @@ -24,7 +24,7 @@ describe('transforms', function () { }) it('should evaluate filter with a callback function', function () { - let scope = {} + const scope = {} parseAndEval('isPositive(x) = x > 0', scope) assert.deepStrictEqual(parseAndEval('filter([6, -2, -1, 4, 3], isPositive)', scope), math.matrix([6, 4, 3])) @@ -54,7 +54,7 @@ describe('transforms', function () { describe('map', function () { it('should execute map on an array with one based indices', function () { const logs = [] - let scope = { + const scope = { A: [1, 2, 3], callback: function (value, index, matrix) { assert.strictEqual(matrix, scope.A) @@ -71,7 +71,7 @@ describe('transforms', function () { it('should execute map on a Matrix with one based indices', function () { const logs = [] - let scope = { + const scope = { A: math.matrix([1, 2, 3]), callback: function (value, index, matrix) { assert.strictEqual(matrix, scope.A) @@ -120,7 +120,7 @@ describe('transforms', function () { describe('forEach', function () { it('should execute forEach on an array with one based indices', function () { const logs = [] - let scope = { + const scope = { A: [1, 2, 3], callback: function (value, index, matrix) { assert.strictEqual(matrix, scope.A) @@ -135,7 +135,7 @@ describe('transforms', function () { it('should execute forEach on a Matrix with one based indices', function () { const logs = [] - let scope = { + const scope = { A: math.matrix([1, 2, 3]), callback: function (value, index, matrix) { assert.strictEqual(matrix, scope.A) @@ -150,7 +150,7 @@ describe('transforms', function () { it('should evaluate forEach with an inline expression as callback (1)', function () { const logs1 = [] - let scope = { + const scope = { callback: function (value) { assert.strictEqual(arguments.length, 1) logs1.push(value) @@ -162,7 +162,7 @@ describe('transforms', function () { it('should evaluate forEach with an inline expression as callback (2)', function () { const logs1 = [] - let scope = { + const scope = { callback: function (value) { assert.strictEqual(arguments.length, 1) logs1.push(value) diff --git a/test/unit-tests/function/algebra/decomposition/qr.test.js b/test/unit-tests/function/algebra/decomposition/qr.test.js index b64bb8d62..7aecb540a 100644 --- a/test/unit-tests/function/algebra/decomposition/qr.test.js +++ b/test/unit-tests/function/algebra/decomposition/qr.test.js @@ -138,18 +138,18 @@ describe('qr', function () { approx.deepEqual( r.Q.valueOf(), [ - [ 0.02241566559605479, 0.9997386855840484, -0.004483133119210979 ], - [ 0.9997386855840484, -0.02243532343507404, -0.004383698101188009 ], - [ 0.004483133119210979, 0.004383698101188009, 0.9999803421609812 ] + [0.02241566559605479, 0.9997386855840484, -0.004483133119210979], + [0.9997386855840484, -0.02243532343507404, -0.004383698101188009], + [0.004483133119210979, 0.004383698101188009, 0.9999803421609812] ]) // R approx.deepEqual( r.R.valueOf(), [ - [ 223.0582883463423, -0, 34.912399165855504 ], - [ -0, -0, 14.305351889173245 ], - [ -0, -0, 18.781141919779493 ] + [223.0582883463423, -0, 34.912399165855504], + [-0, -0, 14.305351889173245], + [-0, -0, 18.781141919779493] ]) // verify assertValidQRDecomposition(m, r.Q, r.R) @@ -214,10 +214,10 @@ describe('qr', function () { r.Q, math.matrix( [ - [ 0.6531972647421809, -0.0050729188524001045, -0.7248169493126636, -0.21897029208715485 ], - [ 0.16329931618554522, -0.13865978196560358, -0.14374377465457616, 0.9661493287513265 ], - [ 0.7348469228349535, -0.07440280983520192, 0.6732450861047025, -0.034717084043718795 ], - [ 0.08164965809277261, 0.9875282032672256, 0.026817368868139818, 0.13191743558805435 ] + [0.6531972647421809, -0.0050729188524001045, -0.7248169493126636, -0.21897029208715485], + [0.16329931618554522, -0.13865978196560358, -0.14374377465457616, 0.9661493287513265], + [0.7348469228349535, -0.07440280983520192, 0.6732450861047025, -0.034717084043718795], + [0.08164965809277261, 0.9875282032672256, 0.026817368868139818, 0.13191743558805435] ] )) // R @@ -225,10 +225,10 @@ describe('qr', function () { r.R, math.matrix( [ - [ 12.24744871391589, 6.858571279792898 ], - [ -0, 94.62008243496727 ], - [ -0, -0 ], - [ -0, -0 ] + [12.24744871391589, 6.858571279792898], + [-0, 94.62008243496727], + [-0, -0], + [-0, -0] ] )) // verify diff --git a/test/unit-tests/function/algebra/simplify.test.js b/test/unit-tests/function/algebra/simplify.test.js index 3cbd24e06..30239d2fa 100644 --- a/test/unit-tests/function/algebra/simplify.test.js +++ b/test/unit-tests/function/algebra/simplify.test.js @@ -343,7 +343,7 @@ describe('simplify', function () { }) it('should compute and simplify derivatives (2)', function () { - let scope = {} + const scope = {} math.evaluate('a = derivative("5x*3x", "x")', scope) const res = math.evaluate('simplify(a)', scope) assert.ok(res && res.isNode) diff --git a/test/unit-tests/function/algebra/solver/lusolve.test.js b/test/unit-tests/function/algebra/solver/lusolve.test.js index ac9a9172c..b76fa4cdd 100644 --- a/test/unit-tests/function/algebra/solver/lusolve.test.js +++ b/test/unit-tests/function/algebra/solver/lusolve.test.js @@ -223,10 +223,10 @@ describe('lusolve', function () { it('should solve linear system 4 x 4, permutations, matrix - Issue 437', function () { const m = math.matrix( [ - [ -1, 1, -1, 1 ], - [ 0, 0, 0, 1 ], - [ 1, 1, 1, 1 ], - [ 8, 4, 2, 1 ] + [-1, 1, -1, 1], + [0, 0, 0, 1], + [1, 1, 1, 1], + [8, 4, 2, 1] ]) const b = [0.1, 0.2, 0.15, 0.1] @@ -239,10 +239,10 @@ describe('lusolve', function () { it('should solve linear system 4 x 4, permutations, sparse - Issue 437', function () { const m = math.sparse( [ - [ -1, 1, -1, 1 ], - [ 0, 0, 0, 1 ], - [ 1, 1, 1, 1 ], - [ 8, 4, 2, 1 ] + [-1, 1, -1, 1], + [0, 0, 0, 1], + [1, 1, 1, 1], + [8, 4, 2, 1] ]) const b = [0.1, 0.2, 0.15, 0.1] diff --git a/test/unit-tests/function/arithmetic/divide.test.js b/test/unit-tests/function/arithmetic/divide.test.js index a8afe803b..08fc0e228 100644 --- a/test/unit-tests/function/arithmetic/divide.test.js +++ b/test/unit-tests/function/arithmetic/divide.test.js @@ -172,13 +172,13 @@ describe('divide', function () { it('should divide 1 over a matrix (matrix inverse)', function () { approx.deepEqual(divide(1, [ - [ 1, 4, 7 ], - [ 3, 0, 5 ], - [ -1, 9, 11 ] + [1, 4, 7], + [3, 0, 5], + [-1, 9, 11] ]), [ - [ 5.625, -2.375, -2.5 ], - [ 4.75, -2.25, -2 ], - [ -3.375, 1.625, 1.5 ] + [5.625, -2.375, -2.5], + [4.75, -2.25, -2], + [-3.375, 1.625, 1.5] ]) }) diff --git a/test/unit-tests/function/bitwise/bitAnd.test.js b/test/unit-tests/function/bitwise/bitAnd.test.js index 258ee7375..db241670c 100644 --- a/test/unit-tests/function/bitwise/bitAnd.test.js +++ b/test/unit-tests/function/bitwise/bitAnd.test.js @@ -139,17 +139,17 @@ describe('bitAnd', function () { // sparse - sparse pattern b = new math.SparseMatrix({ - index: [ 0, 1 ], - ptr: [ 0, 1, 2 ], - size: [ 2, 2 ] + index: [0, 1], + ptr: [0, 1, 2], + size: [2, 2] }) c = bitAnd(a, b) assert.deepStrictEqual( c, new math.SparseMatrix({ - index: [ 0, 1 ], - ptr: [ 0, 1, 2 ], - size: [ 2, 2 ] + index: [0, 1], + ptr: [0, 1, 2], + size: [2, 2] })) // sparse pattern - sparse @@ -157,9 +157,9 @@ describe('bitAnd', function () { assert.deepStrictEqual( c, new math.SparseMatrix({ - index: [ 0, 1 ], - ptr: [ 0, 1, 2 ], - size: [ 2, 2 ] + index: [0, 1], + ptr: [0, 1, 2], + size: [2, 2] })) }) diff --git a/test/unit-tests/function/bitwise/bitOr.test.js b/test/unit-tests/function/bitwise/bitOr.test.js index 8e2a0376f..98917b86c 100644 --- a/test/unit-tests/function/bitwise/bitOr.test.js +++ b/test/unit-tests/function/bitwise/bitOr.test.js @@ -139,9 +139,9 @@ describe('bitOr', function () { // sparse - sparse pattern a = math.sparse([[1, 1], [0, 0]]) b = new math.SparseMatrix({ - index: [ 0, 1 ], - ptr: [ 0, 1, 2 ], - size: [ 2, 2 ] + index: [0, 1], + ptr: [0, 1, 2], + size: [2, 2] }) c = bitOr(a, b) assert.deepStrictEqual( diff --git a/test/unit-tests/function/geometry/distance.test.js b/test/unit-tests/function/geometry/distance.test.js index 54412e744..77caec158 100644 --- a/test/unit-tests/function/geometry/distance.test.js +++ b/test/unit-tests/function/geometry/distance.test.js @@ -54,7 +54,7 @@ describe('distance', function () { it('should calculate pairwise distance between more than two 2D points accurately', function () { assert.deepStrictEqual(math.distance([[1, 2], [1, 2], [1, 3]]), [0, 1, 1]) - assert.deepStrictEqual(math.distance([[0, 2], [-2, 0], [0, 2]]), [ 2.8284271247461903, 0, 2.8284271247461903 ]) + assert.deepStrictEqual(math.distance([[0, 2], [-2, 0], [0, 2]]), [2.8284271247461903, 0, 2.8284271247461903]) assert.deepStrictEqual(math.distance([[1, 2], [2, 3], [2, 4], [3, 0]]), [1.4142135623730951, 2.23606797749979, 2.8284271247461903, 1, 3.1622776601683795, 4.123105625617661]) }) @@ -100,7 +100,7 @@ describe('distance', function () { assert.deepStrictEqual(bigmath.evaluate('distance([1, 2, 3], [-2, -3, -4])'), bignumber('9.1104335791442988819456261046887')) assert.deepStrictEqual(bigmath.evaluate('distance({pointOneX: 0, pointOneY: 0}, {pointTwoX: 10, pointTwoY: 10})'), bignumber('14.142135623730950488016887242097')) assert.deepStrictEqual(bigmath.evaluate('distance({pointOneX: 4, pointOneY: 5, pointOneZ: 8}, {pointTwoX: 2, pointTwoY: 7, pointTwoZ: 10})'), bignumber('3.4641016151377545870548926830117')) - assert.deepStrictEqual(bigmath.evaluate('distance([[0,2],[-2,0],[0,2]])'), [ bignumber('2.8284271247461900976033774484194'), bignumber('0'), bignumber('2.8284271247461900976033774484194') ]) + assert.deepStrictEqual(bigmath.evaluate('distance([[0,2],[-2,0],[0,2]])'), [bignumber('2.8284271247461900976033774484194'), bignumber('0'), bignumber('2.8284271247461900976033774484194')]) assert.deepStrictEqual(bigmath.evaluate('distance([[1,2,4],[1,2,6],[8,1,3]])'), [bignumber('2'), bignumber('7.1414284285428499979993998113673'), bignumber('7.6811457478686081757696870217314')]) assert.deepStrictEqual(bigmath.evaluate('distance([0.23, -0.1240], [-0.232, 13.292], [-0.34, 0.346])'), bignumber('10.658908662088362142660358292758')) assert.deepStrictEqual(bigmath.evaluate('distance({pointX: 1, pointY: 4}, {lineOnePtX: 6, lineOnePtY: 3}, {lineTwoPtX: 2, lineTwoPtY: 8})'), diff --git a/test/unit-tests/function/matrix/apply.test.js b/test/unit-tests/function/matrix/apply.test.js index fa38a430a..3cf5f5388 100644 --- a/test/unit-tests/function/matrix/apply.test.js +++ b/test/unit-tests/function/matrix/apply.test.js @@ -13,10 +13,10 @@ describe('apply', function () { }) const inputMatrix = [ // this is a 4x3x2 matrix, full test coverage - [ [1, 2], [3, 4], [5, 6] ], - [ [7, 8], [9, 10], [11, 12] ], - [ [13, 14], [15, 16], [17, 18] ], - [ [19, 20], [21, 22], [23, 24] ] + [[1, 2], [3, 4], [5, 6]], + [[7, 8], [9, 10], [11, 12]], + [[13, 14], [15, 16], [17, 18]], + [[19, 20], [21, 22], [23, 24]] ] it('should apply to the rows of a tensor', function () { assert.deepStrictEqual(math.apply(inputMatrix, 2, sum), [[3, 7, 11], [15, 19, 23], [27, 31, 35], [39, 43, 47]]) diff --git a/test/unit-tests/function/matrix/concat.test.js b/test/unit-tests/function/matrix/concat.test.js index b50fc869c..b41388a52 100644 --- a/test/unit-tests/function/matrix/concat.test.js +++ b/test/unit-tests/function/matrix/concat.test.js @@ -7,12 +7,12 @@ describe('concat', function () { const b = [[5, 6], [7, 8]] const c = [[9, 10], [11, 12]] const d = [ - [ [1, 2], [3, 4] ], - [ [5, 6], [7, 8] ] + [[1, 2], [3, 4]], + [[5, 6], [7, 8]] ] const e = [ - [ [9, 10], [11, 12] ], - [ [13, 14], [15, 16] ] + [[9, 10], [11, 12]], + [[13, 14], [15, 16]] ] it('should concatenate compatible matrices on the last dimension by default', function () { @@ -35,8 +35,8 @@ describe('concat', function () { ]) assert.deepStrictEqual(math.concat(d, e), [ - [ [1, 2, 9, 10], [3, 4, 11, 12] ], - [ [5, 6, 13, 14], [7, 8, 15, 16] ] + [[1, 2, 9, 10], [3, 4, 11, 12]], + [[5, 6, 13, 14], [7, 8, 15, 16]] ]) }) @@ -62,20 +62,20 @@ describe('concat', function () { ]) assert.deepStrictEqual(math.concat(d, e, 0), [ - [ [1, 2], [3, 4] ], - [ [5, 6], [7, 8] ], - [ [9, 10], [11, 12] ], - [ [13, 14], [15, 16] ] + [[1, 2], [3, 4]], + [[5, 6], [7, 8]], + [[9, 10], [11, 12]], + [[13, 14], [15, 16]] ]) assert.deepStrictEqual(math.concat(d, e, 1), [ - [ [1, 2], [3, 4], [9, 10], [11, 12] ], - [ [5, 6], [7, 8], [13, 14], [15, 16] ] + [[1, 2], [3, 4], [9, 10], [11, 12]], + [[5, 6], [7, 8], [13, 14], [15, 16]] ]) assert.deepStrictEqual(math.concat(d, e, bignumber(1)), [ - [ [1, 2], [3, 4], [9, 10], [11, 12] ], - [ [5, 6], [7, 8], [13, 14], [15, 16] ] + [[1, 2], [3, 4], [9, 10], [11, 12]], + [[5, 6], [7, 8], [13, 14], [15, 16]] ]) }) diff --git a/test/unit-tests/function/matrix/filter.test.js b/test/unit-tests/function/matrix/filter.test.js index b1e074fe0..13de99165 100644 --- a/test/unit-tests/function/matrix/filter.test.js +++ b/test/unit-tests/function/matrix/filter.test.js @@ -35,7 +35,7 @@ describe('filter', function () { it('should invoke a typed function with correct number of arguments (1)', function () { const output = [] math.filter([1, 2, 3], math.typed('callback', { - 'number': function (value) { + number: function (value) { output.push(value + 2) } })) diff --git a/test/unit-tests/function/matrix/forEach.test.js b/test/unit-tests/function/matrix/forEach.test.js index 29b66ec2e..0349508ca 100644 --- a/test/unit-tests/function/matrix/forEach.test.js +++ b/test/unit-tests/function/matrix/forEach.test.js @@ -19,7 +19,7 @@ describe('forEach', function () { it('should invoke a typed function with correct number of arguments (1)', function () { const output = [] math.forEach([1, 2, 3], math.typed('callback', { - 'number': function (value) { + number: function (value) { output.push(value + 2) } })) diff --git a/test/unit-tests/function/matrix/map.test.js b/test/unit-tests/function/matrix/map.test.js index 90db2764b..48b7cab5b 100644 --- a/test/unit-tests/function/matrix/map.test.js +++ b/test/unit-tests/function/matrix/map.test.js @@ -38,7 +38,7 @@ describe('map', function () { it('should invoke a typed function with correct number of arguments (1)', function () { const output = math.map([1, 2, 3], math.typed('callback', { - 'number': function (value) { + number: function (value) { return value + 2 } })) diff --git a/test/unit-tests/function/matrix/subset.test.js b/test/unit-tests/function/matrix/subset.test.js index 0971c92ce..fa7380b12 100644 --- a/test/unit-tests/function/matrix/subset.test.js +++ b/test/unit-tests/function/matrix/subset.test.js @@ -23,13 +23,13 @@ describe('subset', function () { }) it('should get the right subset of an object', function () { - const obj = { 'foo': 'bar' } + const obj = { foo: 'bar' } assert.deepStrictEqual(subset(obj, index('foo')), 'bar') assert.deepStrictEqual(subset(obj, index('bla')), undefined) }) it('should throw an error in case of an invalid subset for an object', function () { - const obj = { 'foo': 'bar' } + const obj = { foo: 'bar' } const i = index('a', 'b') assert.throws(function () { subset(obj, i) }, /DimensionError/) }) diff --git a/test/unit-tests/function/statistics/mean.test.js b/test/unit-tests/function/statistics/mean.test.js index 194148b79..148b4c145 100644 --- a/test/unit-tests/function/statistics/mean.test.js +++ b/test/unit-tests/function/statistics/mean.test.js @@ -51,10 +51,10 @@ describe('mean', function () { }) const inputMatrix = [ // this is a 4x3x2 matrix, full test coverage - [ [10, 20], [30, 40], [50, 60] ], - [ [70, 80], [90, 100], [110, 120] ], - [ [130, 140], [150, 160], [170, 180] ], - [ [190, 200], [210, 220], [230, 240] ] + [[10, 20], [30, 40], [50, 60]], + [[70, 80], [90, 100], [110, 120]], + [[130, 140], [150, 160], [170, 180]], + [[190, 200], [210, 220], [230, 240]] ] it('should return the mean value along a dimension on a matrix', function () { diff --git a/test/unit-tests/function/statistics/std.test.js b/test/unit-tests/function/statistics/std.test.js index aef8aa5e0..06d75e33b 100644 --- a/test/unit-tests/function/statistics/std.test.js +++ b/test/unit-tests/function/statistics/std.test.js @@ -79,10 +79,10 @@ describe('std', function () { }) const inputMatrix = [ // this is a 4x3x2 matrix, full test coverage - [ [10, 200], [30, 40], [50, 60] ], - [ [70, 80], [90, 100], [180, 120] ], - [ [130, 140], [160, 150], [170, 110] ], - [ [190, 20], [210, 220], [230, 240] ] + [[10, 200], [30, 40], [50, 60]], + [[70, 80], [90, 100], [180, 120]], + [[130, 140], [160, 150], [170, 110]], + [[190, 20], [210, 220], [230, 240]] ] it('should return the standard deviation value along a dimension on a matrix', function () { diff --git a/test/unit-tests/function/statistics/sum.test.js b/test/unit-tests/function/statistics/sum.test.js index b37c4dbd0..866a44401 100644 --- a/test/unit-tests/function/statistics/sum.test.js +++ b/test/unit-tests/function/statistics/sum.test.js @@ -75,10 +75,10 @@ describe('sum', function () { }) const inputMatrix = [ // this is a 4x3x2 matrix, full test coverage - [ [10, 20], [30, 40], [50, 60] ], - [ [70, 80], [90, 100], [110, 120] ], - [ [130, 140], [150, 160], [170, 180] ], - [ [190, 200], [210, 220], [230, 240] ] + [[10, 20], [30, 40], [50, 60]], + [[70, 80], [90, 100], [110, 120]], + [[130, 140], [150, 160], [170, 180]], + [[190, 200], [210, 220], [230, 240]] ] it('should return the sum value along a dimension of a matrix', function () { diff --git a/test/unit-tests/function/statistics/variance.test.js b/test/unit-tests/function/statistics/variance.test.js index e24711668..c385c190c 100644 --- a/test/unit-tests/function/statistics/variance.test.js +++ b/test/unit-tests/function/statistics/variance.test.js @@ -77,10 +77,10 @@ describe('variance', function () { }) const inputMatrix = [ // this is a 4x3x2 matrix, full test coverage - [ [10, 200], [30, 40], [50, 60] ], - [ [70, 80], [90, 100], [180, 120] ], - [ [130, 140], [160, 150], [170, 110] ], - [ [190, 20], [210, 220], [230, 240] ] + [[10, 200], [30, 40], [50, 60]], + [[70, 80], [90, 100], [180, 120]], + [[130, 140], [160, 150], [170, 110]], + [[190, 20], [210, 220], [230, 240]] ] it('should return the variance value along a dimension on a matrix', function () { diff --git a/test/unit-tests/json/replacer.test.js b/test/unit-tests/json/replacer.test.js index c1471b664..430e9f29f 100644 --- a/test/unit-tests/json/replacer.test.js +++ b/test/unit-tests/json/replacer.test.js @@ -101,41 +101,41 @@ describe('replacer', function () { it('should stringify a node tree', function () { const node = math.parse('2 + sin(3 x)') const json = { - 'mathjs': 'OperatorNode', - 'op': '+', - 'fn': 'add', - 'args': [ + mathjs: 'OperatorNode', + op: '+', + fn: 'add', + args: [ { - 'mathjs': 'ConstantNode', - 'value': 2 + mathjs: 'ConstantNode', + value: 2 }, { - 'mathjs': 'FunctionNode', - 'fn': { - 'mathjs': 'SymbolNode', - 'name': 'sin' + mathjs: 'FunctionNode', + fn: { + mathjs: 'SymbolNode', + name: 'sin' }, - 'args': [ + args: [ { - 'mathjs': 'OperatorNode', - 'op': '*', - 'fn': 'multiply', - 'args': [ + mathjs: 'OperatorNode', + op: '*', + fn: 'multiply', + args: [ { - 'mathjs': 'ConstantNode', - 'value': 3 + mathjs: 'ConstantNode', + value: 3 }, { - 'mathjs': 'SymbolNode', - 'name': 'x' + mathjs: 'SymbolNode', + name: 'x' } ], - 'implicit': true + implicit: true } ] } ], - 'implicit': false + implicit: false } assert.deepStrictEqual(JSON.parse(JSON.stringify(node)), json) diff --git a/test/unit-tests/json/reviver.test.js b/test/unit-tests/json/reviver.test.js index 3f71ec5e8..0f0d6d981 100644 --- a/test/unit-tests/json/reviver.test.js +++ b/test/unit-tests/json/reviver.test.js @@ -158,41 +158,41 @@ describe('reviver', function () { it('should parse a stringified node tree', function () { const json = JSON.stringify({ - 'mathjs': 'OperatorNode', - 'op': '+', - 'fn': 'add', - 'args': [ + mathjs: 'OperatorNode', + op: '+', + fn: 'add', + args: [ { - 'mathjs': 'ConstantNode', - 'value': 2 + mathjs: 'ConstantNode', + value: 2 }, { - 'mathjs': 'FunctionNode', - 'fn': { - 'mathjs': 'SymbolNode', - 'name': 'sin' + mathjs: 'FunctionNode', + fn: { + mathjs: 'SymbolNode', + name: 'sin' }, - 'args': [ + args: [ { - 'mathjs': 'OperatorNode', - 'op': '*', - 'fn': 'multiply', - 'args': [ + mathjs: 'OperatorNode', + op: '*', + fn: 'multiply', + args: [ { - 'mathjs': 'ConstantNode', - 'value': 3 + mathjs: 'ConstantNode', + value: 3 }, { - 'mathjs': 'SymbolNode', - 'name': 'x' + mathjs: 'SymbolNode', + name: 'x' } ], - 'implicit': true + implicit: true } ] } ], - 'implicit': false + implicit: false }) const node = JSON.parse(json, reviver) diff --git a/test/unit-tests/type/bignumber/BigNumber.test.js b/test/unit-tests/type/bignumber/BigNumber.test.js index 1e0a13bab..7c053bd6c 100644 --- a/test/unit-tests/type/bignumber/BigNumber.test.js +++ b/test/unit-tests/type/bignumber/BigNumber.test.js @@ -13,7 +13,7 @@ describe('BigNumber', function () { }) it('toJSON', function () { - assert.deepStrictEqual(new math.BigNumber(5).toJSON(), { 'mathjs': 'BigNumber', value: '5' }) + assert.deepStrictEqual(new math.BigNumber(5).toJSON(), { mathjs: 'BigNumber', value: '5' }) }) it('fromJSON', function () { diff --git a/test/unit-tests/type/chain/Chain.test.js b/test/unit-tests/type/chain/Chain.test.js index 54a1f1a5f..f5497f082 100644 --- a/test/unit-tests/type/chain/Chain.test.js +++ b/test/unit-tests/type/chain/Chain.test.js @@ -2,6 +2,7 @@ import assert from 'assert' import math from '../../../../src/bundleAny' +import { hasOwnProperty } from '../../../../src/utils/object' const Chain = math.Chain describe('Chain', function () { @@ -94,7 +95,7 @@ describe('Chain', function () { const chain = new Chain() assert.strictEqual(chain.foo, 'bar') - assert.strictEqual(chain.hasOwnProperty('foo'), false) + assert.strictEqual(hasOwnProperty(chain, 'foo'), false) delete Object.prototype.foo }) diff --git a/test/unit-tests/type/complex/Complex.test.js b/test/unit-tests/type/complex/Complex.test.js index 9b082884b..f1dfcf977 100644 --- a/test/unit-tests/type/complex/Complex.test.js +++ b/test/unit-tests/type/complex/Complex.test.js @@ -255,8 +255,8 @@ describe('Complex', function () { }) it('toJSON', function () { - assert.deepStrictEqual(new Complex(2, 4).toJSON(), { 'mathjs': 'Complex', re: 2, im: 4 }) - assert.deepStrictEqual(new Complex(3, 0).toJSON(), { 'mathjs': 'Complex', re: 3, im: 0 }) + assert.deepStrictEqual(new Complex(2, 4).toJSON(), { mathjs: 'Complex', re: 2, im: 4 }) + assert.deepStrictEqual(new Complex(3, 0).toJSON(), { mathjs: 'Complex', re: 3, im: 0 }) }) it('fromJSON', function () { diff --git a/test/unit-tests/type/fraction/Fraction.test.js b/test/unit-tests/type/fraction/Fraction.test.js index cbe7a14ba..659abe95f 100644 --- a/test/unit-tests/type/fraction/Fraction.test.js +++ b/test/unit-tests/type/fraction/Fraction.test.js @@ -18,8 +18,8 @@ describe('Fraction', function () { }) it('toJSON', function () { - assert.deepStrictEqual(new math.Fraction(0.375).toJSON(), { 'mathjs': 'Fraction', n: 3, d: 8 }) - assert.deepStrictEqual(new math.Fraction(-0.375).toJSON(), { 'mathjs': 'Fraction', n: -3, d: 8 }) + assert.deepStrictEqual(new math.Fraction(0.375).toJSON(), { mathjs: 'Fraction', n: 3, d: 8 }) + assert.deepStrictEqual(new math.Fraction(-0.375).toJSON(), { mathjs: 'Fraction', n: -3, d: 8 }) }) it('fromJSON', function () { diff --git a/test/unit-tests/type/matrix/Index.test.js b/test/unit-tests/type/matrix/Index.test.js index 7898d54b5..2c8ceb161 100644 --- a/test/unit-tests/type/matrix/Index.test.js +++ b/test/unit-tests/type/matrix/Index.test.js @@ -130,7 +130,7 @@ describe('Index', function () { it('toJSON', function () { assert.deepStrictEqual(new Index(new Range(0, 10), 2, new ImmutableDenseMatrix([1, 2, 3])).toJSON(), - { 'mathjs': 'Index', + { mathjs: 'Index', dimensions: [ new Range(0, 10, 1), new ImmutableDenseMatrix([2]), diff --git a/test/unit-tests/type/matrix/Range.test.js b/test/unit-tests/type/matrix/Range.test.js index 05b20679e..c00be4b70 100644 --- a/test/unit-tests/type/matrix/Range.test.js +++ b/test/unit-tests/type/matrix/Range.test.js @@ -10,19 +10,19 @@ describe('range', function () { it('should create a range', function () { const r = new Range(2, 6) assert.deepStrictEqual(r.toArray(), [2, 3, 4, 5]) - assert.deepStrictEqual(r.size(), [ 4 ]) + assert.deepStrictEqual(r.size(), [4]) }) it('should create a range with custom step', function () { const r = new Range(10, 4, -1) assert.deepStrictEqual(r.toArray(), [10, 9, 8, 7, 6, 5]) - assert.deepStrictEqual(r.size(), [ 6 ]) + assert.deepStrictEqual(r.size(), [6]) }) it('should create a range with floating points', function () { const r = new Range(1, 5.5, 1.5) assert.deepStrictEqual(r.toArray(), [1, 2.5, 4]) - assert.deepStrictEqual(r.size(), [ 3 ]) + assert.deepStrictEqual(r.size(), [3]) }) it('should create an empty range', function () { @@ -33,17 +33,17 @@ describe('range', function () { it('should create a range with only one value', function () { const r = new Range(0, 1) assert.deepStrictEqual(r.toArray(), [0]) - assert.deepStrictEqual(r.size(), [ 1 ]) + assert.deepStrictEqual(r.size(), [1]) }) it('should create an empty range because of wrong step size', function () { let r = new Range(0, 10, 0) assert.deepStrictEqual(r.toArray(), []) - assert.deepStrictEqual(r.size(), [ 0 ]) + assert.deepStrictEqual(r.size(), [0]) r = new Range(0, 10, -1) assert.deepStrictEqual(r.toArray(), []) - assert.deepStrictEqual(r.size(), [ 0 ]) + assert.deepStrictEqual(r.size(), [0]) }) it('should throw an error when created without new keyword', function () { @@ -61,11 +61,11 @@ describe('range', function () { it('should create a range from a string', function () { let r = Range.parse('10:-1:4') assert.deepStrictEqual(r.toArray(), [10, 9, 8, 7, 6, 5]) - assert.deepStrictEqual(r.size(), [ 6 ]) + assert.deepStrictEqual(r.size(), [6]) r = Range.parse('2 : 6') assert.deepStrictEqual(r.toArray(), [2, 3, 4, 5]) - assert.deepStrictEqual(r.size(), [ 4 ]) + assert.deepStrictEqual(r.size(), [4]) }) it('should return null when parsing an invalid string', function () { @@ -250,8 +250,8 @@ describe('range', function () { }) it('toJSON', function () { - assert.deepStrictEqual(new Range(2, 4).toJSON(), { 'mathjs': 'Range', start: 2, end: 4, step: 1 }) - assert.deepStrictEqual(new Range(0, 10, 2).toJSON(), { 'mathjs': 'Range', start: 0, end: 10, step: 2 }) + assert.deepStrictEqual(new Range(2, 4).toJSON(), { mathjs: 'Range', start: 2, end: 4, step: 1 }) + assert.deepStrictEqual(new Range(0, 10, 2).toJSON(), { mathjs: 'Range', start: 0, end: 10, step: 2 }) }) it('fromJSON', function () { diff --git a/test/unit-tests/type/matrix/SparseMatrix.test.js b/test/unit-tests/type/matrix/SparseMatrix.test.js index 31af7d706..4b6dc5cb3 100644 --- a/test/unit-tests/type/matrix/SparseMatrix.test.js +++ b/test/unit-tests/type/matrix/SparseMatrix.test.js @@ -694,10 +694,10 @@ describe('SparseMatrix', function () { it('should get matrix element - Issue #450', function () { const m = new SparseMatrix({ mathjs: 'SparseMatrix', - values: [ 3, 10, 3, 9, 7, 4, 8, 8, 8, 7, 7, 9, -2, 5, 9, 2, 3, -1, 13 ], - index: [ 1, 0, 3, 1, 2, 5, 4, 2, 3, 2, 3, 4, 0, 3, 4, 5, 1, 5, 4 ], - ptr: [ 0, 3, 7, 9, 12, 16, 19 ], - size: [ 6, 6 ], + values: [3, 10, 3, 9, 7, 4, 8, 8, 8, 7, 7, 9, -2, 5, 9, 2, 3, -1, 13], + index: [1, 0, 3, 1, 2, 5, 4, 2, 3, 2, 3, 4, 0, 3, 4, 5, 1, 5, 4], + ptr: [0, 3, 7, 9, 12, 16, 19], + size: [6, 6], datatype: undefined }) @@ -1446,10 +1446,10 @@ describe('SparseMatrix', function () { }) const expectedLogs = [ - { value: 1, index: [ 0, 0 ] }, - { value: 3, index: [ 1, 0 ] }, - { value: 2, index: [ 0, 1 ] }, - { value: 4, index: [ 1, 1 ] } + { value: 1, index: [0, 0] }, + { value: 3, index: [1, 0] }, + { value: 2, index: [0, 1] }, + { value: 4, index: [1, 1] } ] it('should have parsed the two test matrices correctly', () => { diff --git a/test/unit-tests/type/matrix/utils/getMatrixDataType.test.js b/test/unit-tests/type/matrix/utils/getMatrixDataType.test.js index b68b05c74..eb2db2dfa 100644 --- a/test/unit-tests/type/matrix/utils/getMatrixDataType.test.js +++ b/test/unit-tests/type/matrix/utils/getMatrixDataType.test.js @@ -7,42 +7,42 @@ const getMatrixDataType = math.getMatrixDataType describe('getMatrixDataType', function () { describe('array', function () { it('should return number for pure numbers', function () { - const result = getMatrixDataType([ [1, 2, 3], [4, 5, 6], [1, 8, 9] ]) + const result = getMatrixDataType([[1, 2, 3], [4, 5, 6], [1, 8, 9]]) assert.strictEqual('number', result) }) it('should return number for pure numbers with NaN', function () { - const result = getMatrixDataType([ [1, 2, NaN], [4, 5, 6], [1, 8, 9] ]) + const result = getMatrixDataType([[1, 2, NaN], [4, 5, 6], [1, 8, 9]]) assert.strictEqual('number', result) }) it('should return string', function () { - const result = getMatrixDataType([ ['string'], ['test'] ]) + const result = getMatrixDataType([['string'], ['test']]) assert.strictEqual('string', result) }) it('should return boolean', function () { - const result = getMatrixDataType([ [true], [false] ]) + const result = getMatrixDataType([[true], [false]]) assert.strictEqual('boolean', result) }) it('should return undefined', function () { - const result = getMatrixDataType([ [undefined], [undefined] ]) + const result = getMatrixDataType([[undefined], [undefined]]) assert.strictEqual('undefined', result) }) it('should return null', function () { - const result = getMatrixDataType([ [null], [null] ]) + const result = getMatrixDataType([[null], [null]]) assert.strictEqual('null', result) }) it('should return mixed when number and null are given', function () { - const result = getMatrixDataType([ [1], [null] ]) + const result = getMatrixDataType([[1], [null]]) assert.strictEqual('mixed', result) }) it('should return mixed when number and string are given', function () { - const result = getMatrixDataType([ [1], ['string'] ]) + const result = getMatrixDataType([[1], ['string']]) assert.strictEqual('mixed', result) }) it('should return undefined if the input is not a matrix', function () { // Not equal in size and one is an empty array - const result1 = getMatrixDataType([ [1], [] ]) + const result1 = getMatrixDataType([[1], []]) // Not equal in size - const result2 = getMatrixDataType([ [1, 2, 3], [1, 2] ]) + const result2 = getMatrixDataType([[1, 2, 3], [1, 2]]) // Empty array as an input const result3 = getMatrixDataType([]) @@ -55,17 +55,17 @@ describe('getMatrixDataType', function () { describe('extra type BigNumber', function () { it('should return BigNumber', function () { const zero = math.bignumber(0) - const bignumberMatrix = getMatrixDataType([ [zero], [zero] ]) + const bignumberMatrix = getMatrixDataType([[zero], [zero]]) assert.strictEqual(bignumberMatrix, 'BigNumber') }) it('should return mixed', function () { const zero = math.bignumber(0) - const bignumberMatrix = getMatrixDataType([ [zero], [2] ]) + const bignumberMatrix = getMatrixDataType([[zero], [2]]) assert.strictEqual(bignumberMatrix, 'mixed') }) it('should return undefined', function () { const zero = math.bignumber(0) - const bignumberMatrix = getMatrixDataType([ [zero], [] ]) + const bignumberMatrix = getMatrixDataType([[zero], []]) assert.strictEqual(bignumberMatrix, undefined) }) }) @@ -73,17 +73,17 @@ describe('getMatrixDataType', function () { describe('extra type Unit', function () { it('should return Unit', function () { const x = math.unit('5cm') - const unitMatrix = getMatrixDataType([ [x], [x] ]) + const unitMatrix = getMatrixDataType([[x], [x]]) assert.strictEqual(unitMatrix, 'Unit') }) it('should return mixed', function () { const x = math.unit('5cm') - const unitMatrix = getMatrixDataType([ [x], [2] ]) + const unitMatrix = getMatrixDataType([[x], [2]]) assert.strictEqual(unitMatrix, 'mixed') }) it('should return undefined', function () { const x = math.unit('5cm') - const unitMatrix = getMatrixDataType([ [x], [] ]) + const unitMatrix = getMatrixDataType([[x], []]) assert.strictEqual(unitMatrix, undefined) }) }) @@ -91,24 +91,24 @@ describe('getMatrixDataType', function () { describe('extra type Fraction', function () { it('should return Fraction', function () { const x = math.fraction(1, 3) - const fractionMatrix = getMatrixDataType([ [x], [x] ]) + const fractionMatrix = getMatrixDataType([[x], [x]]) assert.strictEqual(fractionMatrix, 'Fraction') }) it('should return mixed', function () { const x = math.fraction(1, 3) - const fractionMatrix = getMatrixDataType([ [x], [2] ]) + const fractionMatrix = getMatrixDataType([[x], [2]]) assert.strictEqual(fractionMatrix, 'mixed') }) it('should return undefined', function () { const x = math.fraction(1, 3) - const fractionMatrix = getMatrixDataType([ [x], [] ]) + const fractionMatrix = getMatrixDataType([[x], []]) assert.strictEqual(fractionMatrix, undefined) }) }) describe('SparseMatrix', function () { it('should return number for pure numbers', function () { - const matrix = new SparseMatrix([ [1, 2, 3], [4, 5, 6], [1, 8, 9] ]) + const matrix = new SparseMatrix([[1, 2, 3], [4, 5, 6], [1, 8, 9]]) const result1 = getMatrixDataType(matrix) const result2 = matrix.getDataType() assert.strictEqual('number', result1) @@ -116,7 +116,7 @@ describe('getMatrixDataType', function () { }) it('should return number for pure numbers with NaN', function () { - const matrix = new SparseMatrix([ [1, 2, NaN], [4, 5, 6], [1, 8, 9] ]) + const matrix = new SparseMatrix([[1, 2, NaN], [4, 5, 6], [1, 8, 9]]) const result1 = getMatrixDataType(matrix) const result2 = matrix.getDataType() assert.strictEqual('number', result1) @@ -126,7 +126,7 @@ describe('getMatrixDataType', function () { describe('DenseMatrix', function () { it('should return number for pure numbers', function () { - const matrix = new DenseMatrix([ [1, 2, 3], [4, 5, 6], [1, 8, 9] ]) + const matrix = new DenseMatrix([[1, 2, 3], [4, 5, 6], [1, 8, 9]]) const result1 = getMatrixDataType(matrix) const result2 = matrix.getDataType() assert.strictEqual('number', result1) @@ -134,49 +134,49 @@ describe('getMatrixDataType', function () { }) it('should return number for pure numbers with NaN', function () { - const matrix = new DenseMatrix([ [1, 2, NaN], [4, 5, 6], [1, 8, 9] ]) + const matrix = new DenseMatrix([[1, 2, NaN], [4, 5, 6], [1, 8, 9]]) const result1 = getMatrixDataType(matrix) const result2 = matrix.getDataType() assert.strictEqual('number', result1) assert.strictEqual('number', result2) }) it('should return string', function () { - const matrix = new DenseMatrix([ ['string'], ['test'] ]) + const matrix = new DenseMatrix([['string'], ['test']]) const result1 = getMatrixDataType(matrix) const result2 = matrix.getDataType() assert.strictEqual('string', result1) assert.strictEqual('string', result2) }) it('should return boolean', function () { - const matrix = new DenseMatrix([ [true], [false] ]) + const matrix = new DenseMatrix([[true], [false]]) const result1 = getMatrixDataType(matrix) const result2 = matrix.getDataType() assert.strictEqual('boolean', result1) assert.strictEqual('boolean', result2) }) it('should return undefined', function () { - const matrix = new DenseMatrix([ [undefined], [undefined] ]) + const matrix = new DenseMatrix([[undefined], [undefined]]) const result1 = getMatrixDataType(matrix) const result2 = matrix.getDataType() assert.strictEqual('undefined', result1) assert.strictEqual('undefined', result2) }) it('should return null', function () { - const matrix = new DenseMatrix([ [null], [null] ]) + const matrix = new DenseMatrix([[null], [null]]) const result1 = getMatrixDataType(matrix) const result2 = matrix.getDataType() assert.strictEqual('null', result1) assert.strictEqual('null', result2) }) it('should return mixed when number and null are given', function () { - const matrix = new DenseMatrix([ [1], [null] ]) + const matrix = new DenseMatrix([[1], [null]]) const result1 = getMatrixDataType(matrix) const result2 = matrix.getDataType() assert.strictEqual('mixed', result1) assert.strictEqual('mixed', result2) }) it('should return mixed when number and string are given', function () { - const matrix = new DenseMatrix([ [1], ['string'] ]) + const matrix = new DenseMatrix([[1], ['string']]) const result1 = getMatrixDataType(matrix) const result2 = matrix.getDataType() assert.strictEqual('mixed', result1) diff --git a/test/unit-tests/type/numeric.test.js b/test/unit-tests/type/numeric.test.js index 3d12f4ce0..9cee72891 100644 --- a/test/unit-tests/type/numeric.test.js +++ b/test/unit-tests/type/numeric.test.js @@ -68,10 +68,10 @@ describe('numeric', function () { }) it('should return the same object if input/output types match', function () { - let bn1 = math.bignumber(123) + const bn1 = math.bignumber(123) assert.strictEqual(bn1, numeric(bn1, 'BigNumber')) - let fr1 = math.fraction(1, 3) + const fr1 = math.fraction(1, 3) assert.strictEqual(fr1, numeric(fr1, 'Fraction')) }) diff --git a/test/unit-tests/type/resultset/ResultSet.test.js b/test/unit-tests/type/resultset/ResultSet.test.js index 78cbbb9ef..68af9f666 100644 --- a/test/unit-tests/type/resultset/ResultSet.test.js +++ b/test/unit-tests/type/resultset/ResultSet.test.js @@ -43,13 +43,13 @@ describe('ResultSet', function () { it('toJSON', function () { const r = new ResultSet([1, 2, 3]) - const json = { 'mathjs': 'ResultSet', 'entries': [1, 2, 3] } + const json = { mathjs: 'ResultSet', entries: [1, 2, 3] } assert.deepStrictEqual(r.toJSON(), json) }) it('fromJSON', function () { const r1 = new ResultSet([1, 2, 3]) - const json = { 'mathjs': 'ResultSet', 'entries': [1, 2, 3] } + const json = { mathjs: 'ResultSet', entries: [1, 2, 3] } const r2 = ResultSet.fromJSON(json) assert(r2 instanceof ResultSet) assert.deepStrictEqual(r2, r1) diff --git a/test/unit-tests/type/unit/Unit.test.js b/test/unit-tests/type/unit/Unit.test.js index add336586..78749942d 100644 --- a/test/unit-tests/type/unit/Unit.test.js +++ b/test/unit-tests/type/unit/Unit.test.js @@ -584,8 +584,8 @@ describe('Unit', function () { it('should simplify user-defined units when unit system is "auto"', function () { Unit.setUnitSystem('auto') - Unit.createUnit({ 'USD': '' }) - Unit.createUnit({ 'EUR': '1.15 USD' }) + Unit.createUnit({ USD: '' }) + Unit.createUnit({ EUR: '1.15 USD' }) assert.strictEqual(math.evaluate('10 EUR/hour * 2 hours').toString(), '20 EUR') }) }) @@ -604,11 +604,11 @@ describe('Unit', function () { describe('json', function () { it('toJSON', function () { assert.deepStrictEqual(new Unit(5, 'cm').toJSON(), - { 'mathjs': 'Unit', value: 5, unit: 'cm', fixPrefix: false }) + { mathjs: 'Unit', value: 5, unit: 'cm', fixPrefix: false }) assert.deepStrictEqual(new Unit(5, 'cm').to('mm').toJSON(), - { 'mathjs': 'Unit', value: 50, unit: 'mm', fixPrefix: true }) + { mathjs: 'Unit', value: 50, unit: 'mm', fixPrefix: true }) assert.deepStrictEqual(new Unit(5, 'kN').to('kg m s ^ -2').toJSON(), - { 'mathjs': 'Unit', value: 5000, unit: '(kg m) / s^2', fixPrefix: true }) + { mathjs: 'Unit', value: 5000, unit: '(kg m) / s^2', fixPrefix: true }) assert.deepStrictEqual(new Unit(math.fraction(0.375), 'cm').toJSON(), { mathjs: 'Unit', @@ -633,17 +633,17 @@ describe('Unit', function () { it('fromJSON', function () { const u1 = new Unit(5, 'cm') - const u2 = Unit.fromJSON({ 'mathjs': 'Unit', value: 5, unit: 'cm', fixPrefix: false }) + const u2 = Unit.fromJSON({ mathjs: 'Unit', value: 5, unit: 'cm', fixPrefix: false }) assert.ok(u2 instanceof Unit) assert.deepStrictEqual(u2, u1) const u3 = new Unit(5, 'cm').to('mm') - const u4 = Unit.fromJSON({ 'mathjs': 'Unit', value: 50, unit: 'mm', fixPrefix: true }) + const u4 = Unit.fromJSON({ mathjs: 'Unit', value: 50, unit: 'mm', fixPrefix: true }) assert.ok(u4 instanceof Unit) assert.deepStrictEqual(u4, u3) const u5 = new Unit(5, 'kN').to('kg m/s^2') - const u6 = Unit.fromJSON({ 'mathjs': 'Unit', value: 5000, unit: 'kg m s^-2', fixPrefix: true }) + const u6 = Unit.fromJSON({ mathjs: 'Unit', value: 5000, unit: 'kg m s^-2', fixPrefix: true }) assert.ok(u6 instanceof Unit) assert.deepStrictEqual(u5, u6) @@ -1169,9 +1169,9 @@ describe('Unit', function () { describe('createUnit', function () { it('should create multiple units', function () { Unit.createUnit({ - 'foo1': '', - 'foo2': '2 foo1', - 'foo3': { + foo1: '', + foo2: '2 foo1', + foo3: { definition: '2 foo2', prefixes: 'long' } @@ -1198,7 +1198,7 @@ describe('Unit', function () { assert.strictEqual((new Unit(1, 'm')).splitUnit(['ft', 'ft']).toString(), '3 ft,0.280839895013123 ft') assert.strictEqual((new Unit(1.23, 'm/s')).splitUnit([]).toString(), '1.23 m / s') assert.strictEqual((new Unit(1, 'm')).splitUnit(['in', 'ft']).toString(), '39 in,0.030839895013123605 ft') - assert.strictEqual((new Unit(1, 'm')).splitUnit([ new Unit(null, 'ft'), new Unit(null, 'in') ]).toString(), '3 ft,3.3700787401574765 in') + assert.strictEqual((new Unit(1, 'm')).splitUnit([new Unit(null, 'ft'), new Unit(null, 'in')]).toString(), '3 ft,3.3700787401574765 in') }) it('should be resistant to round-off error', function () { diff --git a/test/unit-tests/utils/customs.test.js b/test/unit-tests/utils/customs.test.js index 11fec0ea3..66bfd61ac 100644 --- a/test/unit-tests/utils/customs.test.js +++ b/test/unit-tests/utils/customs.test.js @@ -7,7 +7,7 @@ import math from '../../../src/bundleAny' describe('customs', function () { describe('isSafeMethod', function () { it('plain objects', function () { - let object = { + const object = { fn: function () {} } assert.strictEqual(isSafeMethod(object, 'fn'), true) @@ -28,7 +28,7 @@ describe('customs', function () { assert.strictEqual(isSafeMethod(object, 'foo'), false) // custom inherited method - let object1 = { + const object1 = { foo: function () {} } const object2 = Object.create(object1) @@ -61,12 +61,12 @@ describe('customs', function () { assert.strictEqual(isSafeMethod(unit, 'toString'), true) // extend the class instance with a custom method - let object = math.matrix() + const object = math.matrix() object.foo = function () {} assert.strictEqual(isSafeMethod(object, 'foo'), true) // extend the class instance with a ghosted method - let object2 = math.matrix() + const object2 = math.matrix() object2.toJSON = function () {} assert.strictEqual(isSafeMethod(object2, 'toJSON'), false) diff --git a/test/unit-tests/utils/factory.test.js b/test/unit-tests/utils/factory.test.js index 51535e5b5..a59471501 100644 --- a/test/unit-tests/utils/factory.test.js +++ b/test/unit-tests/utils/factory.test.js @@ -38,16 +38,16 @@ describe('factory', function () { function fn4 () { return 4 } function fn5 () { return 5 } - assert.deepStrictEqual(sortFactories([ fn3factory, fn2factory, fn1, fn4, fn5 ]) + assert.deepStrictEqual(sortFactories([fn3factory, fn2factory, fn1, fn4, fn5]) .map(f => f.fn || f.name), ['fn1', 'fn2', 'fn3', 'fn4', 'fn5']) - assert.deepStrictEqual(sortFactories([ fn1, fn2factory, fn3factory, fn4, fn5 ]) + assert.deepStrictEqual(sortFactories([fn1, fn2factory, fn3factory, fn4, fn5]) .map(f => f.fn || f.name), ['fn1', 'fn2', 'fn3', 'fn4', 'fn5']) - assert.deepStrictEqual(sortFactories([ fn4, fn5, fn1, fn2factory, fn3factory ]) + assert.deepStrictEqual(sortFactories([fn4, fn5, fn1, fn2factory, fn3factory]) .map(f => f.fn || f.name), ['fn1', 'fn2', 'fn3', 'fn4', 'fn5']) - assert.deepStrictEqual(sortFactories([ fn5, fn4, fn1, fn2factory, fn3factory ]) + assert.deepStrictEqual(sortFactories([fn5, fn4, fn1, fn2factory, fn3factory]) .map(f => f.fn || f.name), ['fn1', 'fn2', 'fn3', 'fn5', 'fn4']) }) @@ -57,7 +57,7 @@ describe('factory', function () { const fn3 = factory('fn3', [], () => {}) const fn4 = factory('fn4', ['fn3'], () => {}) - assert.deepStrictEqual(sortFactories([ fn1, fn2, fn3, fn4 ]) + assert.deepStrictEqual(sortFactories([fn1, fn2, fn3, fn4]) .map(f => f.fn || f.name), ['fn1', 'fn3', 'fn4', 'fn2']) }) @@ -66,10 +66,10 @@ describe('factory', function () { const fn1factory = factory('fn1', ['fn2'], () => {}) const fn2factory = factory('fn2', ['fn1'], () => {}) - assert.deepStrictEqual(sortFactories([ fn1factory, fn2factory ]) + assert.deepStrictEqual(sortFactories([fn1factory, fn2factory]) .map(f => f.fn), ['fn1', 'fn2']) - assert.deepStrictEqual(sortFactories([ fn2factory, fn1factory ]) + assert.deepStrictEqual(sortFactories([fn2factory, fn1factory]) .map(f => f.fn), ['fn2', 'fn1']) }) diff --git a/test/unit-tests/utils/function.test.js b/test/unit-tests/utils/function.test.js index fe3dc8228..a92752965 100644 --- a/test/unit-tests/utils/function.test.js +++ b/test/unit-tests/utils/function.test.js @@ -100,28 +100,28 @@ describe('util.function', function () { const a = function () {} a.signatures = { 'number, number': function () {}, - 'number': function () {} + number: function () {} } assert.strictEqual(maxArgumentCount(a), 2) const b = function () {} b.signatures = { - 'number': function () {}, + number: function () {}, 'number, number': function () {} } assert.strictEqual(maxArgumentCount(b), 2) const c = function () {} c.signatures = { - 'number': function () {}, - 'BigNumber': function () {} + number: function () {}, + BigNumber: function () {} } assert.strictEqual(maxArgumentCount(c), 1) const d = function () {} d.signatures = { 'number,number': function () {}, - 'number': function () {}, + number: function () {}, 'number,any,number': function () {} } assert.strictEqual(maxArgumentCount(d), 3) diff --git a/test/unit-tests/utils/object.test.js b/test/unit-tests/utils/object.test.js index e83c0a8cc..6c6d75153 100644 --- a/test/unit-tests/utils/object.test.js +++ b/test/unit-tests/utils/object.test.js @@ -11,7 +11,7 @@ import { pick, set, traverse, - deepFlatten + deepFlatten, hasOwnProperty } from '../../../src/utils/object' describe('object', function () { @@ -102,7 +102,7 @@ describe('object', function () { const o2 = extend({}, o1) assert.strictEqual(o2['foo'], 'bar') - assert.strictEqual(o2.hasOwnProperty('foo'), false) + assert.strictEqual(hasOwnProperty(o2, 'foo'), false) delete Object.prototype.foo }) @@ -137,7 +137,7 @@ describe('object', function () { const o2 = deepExtend({}, o1) assert.strictEqual(o2['foo'], 'bar') - assert.strictEqual(o2.hasOwnProperty('foo'), false) + assert.strictEqual(hasOwnProperty(o2, 'foo'), false) delete Object.prototype.foo }) diff --git a/tools/approx.js b/tools/approx.js index 9e9093dd7..508e0131b 100644 --- a/tools/approx.js +++ b/tools/approx.js @@ -1,4 +1,5 @@ const assert = require('assert') +const hasOwnProperty = require('./utils').hasOwnProperty const EPSILON = 0.0001 @@ -74,15 +75,15 @@ exports.deepEqual = function deepEqual (a, b) { } } else if (a instanceof Object && b instanceof Object) { for (prop in a) { - if (a.hasOwnProperty(prop)) { - assert.ok(b.hasOwnProperty(prop), a[prop] + ' ~= ' + b[prop]) + if (hasOwnProperty(a, prop)) { + assert.ok(hasOwnProperty(b, prop), a[prop] + ' ~= ' + b[prop]) deepEqual(a[prop], b[prop]) } } for (prop in b) { - if (b.hasOwnProperty(prop)) { - assert.ok(a.hasOwnProperty(prop), a[prop] + ' ~= ' + b[prop]) + if (hasOwnProperty(b, prop)) { + assert.ok(hasOwnProperty(a, prop), a[prop] + ' ~= ' + b[prop]) deepEqual(a[prop], b[prop]) } } diff --git a/tools/docgenerator.js b/tools/docgenerator.js index de39284e0..6681f6449 100644 --- a/tools/docgenerator.js +++ b/tools/docgenerator.js @@ -37,7 +37,7 @@ const SYNTAX = { random: 'math.random([min, max])', randomInt: 'math.randomInt([min, max])', format: 'math.format(value [, precision])', - 'import': 'math.import(object, override)', + import: 'math.import(object, override)', print: 'math.print(template, values [, precision])' } @@ -292,7 +292,7 @@ function generateDoc (name, code) { } // initialize doc - let doc = { + const doc = { name: name, description: '', syntax: [], @@ -332,7 +332,7 @@ function generateDoc (name, code) { * @return {String[]} issues */ function validateDoc (doc) { - let issues = [] + const issues = [] function ignore (field) { return IGNORE_WARNINGS[field].indexOf(doc.name) !== -1 @@ -491,7 +491,7 @@ function iteratePath (functionNames, inputPath, outputPath, outputRoot) { } // generate path information for each of the files - let functions = {} // TODO: change to array + const functions = {} // TODO: change to array files.forEach(function (fullPath) { const path = fullPath.split('/') @@ -536,25 +536,23 @@ function iteratePath (functionNames, inputPath, outputPath, outputRoot) { // loop over all files, generate a doc for each of them let issues = [] - for (const name in functions) { - if (functions.hasOwnProperty(name)) { - const fn = functions[name] - const code = String(fs.readFileSync(fn.fullPath)) + Object.keys(functions).forEach(name => { + const fn = functions[name] + const code = String(fs.readFileSync(fn.fullPath)) - const isFunction = (functionNames.indexOf(name) !== -1) && !IGNORE_FUNCTIONS[name] - const doc = isFunction ? generateDoc(name, code) : null + const isFunction = (functionNames.indexOf(name) !== -1) && !IGNORE_FUNCTIONS[name] + const doc = isFunction ? generateDoc(name, code) : null - if (isFunction && doc) { - fn.doc = doc - issues = issues.concat(validateDoc(doc)) - const markdown = generateMarkdown(doc, functions) - fs.writeFileSync(outputPath + '/' + fn.name + '.md', markdown) - } else { - // log('Ignoring', fn.fullPath) - delete functions[name] - } + if (isFunction && doc) { + fn.doc = doc + issues = issues.concat(validateDoc(doc)) + const markdown = generateMarkdown(doc, functions) + fs.writeFileSync(outputPath + '/' + fn.name + '.md', markdown) + } else { + // log('Ignoring', fn.fullPath) + delete functions[name] } - } + }) /** * Helper function to generate a markdown list entry for a function. @@ -604,7 +602,7 @@ function iteratePath (functionNames, inputPath, outputPath, outputRoot) { } // generate categorical page with all functions - let categories = {} + const categories = {} Object.keys(functions).forEach(function (name) { const fn = functions[name] const category = categories[fn.category] diff --git a/tools/entryGenerator.js b/tools/entryGenerator.js index e2d97e1f7..e746260c0 100644 --- a/tools/entryGenerator.js +++ b/tools/entryGenerator.js @@ -1,35 +1,36 @@ const fs = require('fs') const path = require('path') const Handlebars = require('handlebars') +const hasOwnProperty = require('./utils').hasOwnProperty const ENTRY_FOLDER = path.join(__dirname, '../src/entry') const IGNORED_DEPENDENCIES = { - 'on': true, - 'config': true, - 'math': true, - 'mathWithTransform': true, - 'classes': true + on: true, + config: true, + math: true, + mathWithTransform: true, + classes: true } const DEPRECATED_FACTORIES = { - 'typeof': 'typeOf', - 'var': 'variance', - 'eval': 'evaluate', - 'E': 'e', - 'PI': 'pi' + typeof: 'typeOf', + var: 'variance', + eval: 'evaluate', + E: 'e', + PI: 'pi' } const FACTORY_NAMES_ES6_MAPPING = { - 'true': '_true', - 'false': '_false', - 'NaN': '_NaN', - 'null': '_null', - 'Infinity': '_Infinity' + true: '_true', + false: '_false', + NaN: '_NaN', + null: '_null', + Infinity: '_Infinity' } const IGNORED_DEPENDENCIES_ES6 = { - 'on': true + on: true } const dependenciesIndexTemplate = Handlebars.compile(`/** @@ -458,7 +459,7 @@ function getDependenciesFileName (factoryName) { function findFactoryName (factories, name) { for (const factoryName in factories) { - if (factories.hasOwnProperty(factoryName)) { + if (hasOwnProperty(factories, factoryName)) { if (factories[factoryName].fn === name) { return factoryName } @@ -470,7 +471,7 @@ function findFactoryName (factories, name) { function findKey (object, value) { for (const key in object) { - if (object.hasOwnProperty(key)) { + if (hasOwnProperty(object, key)) { if (object[key] === value) { return key } diff --git a/tools/matrixmarket.js b/tools/matrixmarket.js index 447eb9270..b04707c5a 100644 --- a/tools/matrixmarket.js +++ b/tools/matrixmarket.js @@ -275,11 +275,11 @@ const _importFromStream = function (stream) { * Imports a Matrix Market matrix from the filesystem. (https://math.nist.gov/MatrixMarket/) */ const _import = typed('importMatrix', { - 'Array': function (files) { + Array: function (files) { return Promise.all(files.map(file => _import(file))) }, - 'string': function (file) { - let input = fs.createReadStream(file) + string: function (file) { + const input = fs.createReadStream(file) return _importFromStream(input) } }) diff --git a/tools/utils.js b/tools/utils.js new file mode 100644 index 000000000..55cf4f2ca --- /dev/null +++ b/tools/utils.js @@ -0,0 +1,8 @@ + +// helper function to safely check whether an object as a property +// copy from the function in object.js which is ES6 +function hasOwnProperty (object, property) { + return object && Object.hasOwnProperty.call(object, property) +} + +exports.hasOwnProperty = hasOwnProperty diff --git a/tools/whitelistgenerator.js b/tools/whitelistgenerator.js index 5243d40b6..037382dd8 100644 --- a/tools/whitelistgenerator.js +++ b/tools/whitelistgenerator.js @@ -1,4 +1,5 @@ // generates a whitelist of safe methods and functions +const hasOwnProperty = require('./utils').hasOwnProperty // math.js functions (can be used when chaining const math = require('../index') @@ -8,7 +9,7 @@ const chain = { toString: true } for (const name in math) { - if (math.hasOwnProperty(name) && typeof math[name] === 'function') { + if (hasOwnProperty(math, name) && typeof math[name] === 'function') { chain[name] = true } } @@ -18,71 +19,71 @@ const groups = [ // Unit { - 'valueOf': true, - 'clone': true, - 'hasBase': true, - 'equalBase': true, - 'equals': true, - 'multiply': true, - 'divide': true, - 'pow': true, - 'abs': true, - 'to': true, - 'toNumber': true, - 'toNumeric': true, - 'format': true, - 'formatUnits': true, - 'toString': true + valueOf: true, + clone: true, + hasBase: true, + equalBase: true, + equals: true, + multiply: true, + divide: true, + pow: true, + abs: true, + to: true, + toNumber: true, + toNumeric: true, + format: true, + formatUnits: true, + toString: true }, // Complex { - 'sign': true, - 'add': true, - 'sub': true, - 'mul': true, - 'div': true, - 'pow': true, - 'sqrt': true, - 'exp': true, - 'log': true, - 'abs': true, - 'arg': true, - 'inverse': true, - 'conjugate': true, - 'neg': true, - 'floor': true, - 'ceil': true, - 'round': true, - 'equals': true, - 'isNaN': true, - 'clone': true, - 'toVector': true, - 'toString': true, - 'sin': true, - 'cos': true, - 'tan': true, - 'cot': true, - 'sec': true, - 'csc': true, - 'asin': true, - 'acos': true, - 'atan': true, - 'acot': true, - 'asec': true, - 'acsc': true, - 'sinh': true, - 'cosh': true, - 'tanh': true, - 'coth': true, - 'sech': true, - 'csch': true, - 'asinh': true, - 'acosh': true, - 'atanh': true, - 'acoth': true, - 'asech': true, - 'acsch': true + sign: true, + add: true, + sub: true, + mul: true, + div: true, + pow: true, + sqrt: true, + exp: true, + log: true, + abs: true, + arg: true, + inverse: true, + conjugate: true, + neg: true, + floor: true, + ceil: true, + round: true, + equals: true, + isNaN: true, + clone: true, + toVector: true, + toString: true, + sin: true, + cos: true, + tan: true, + cot: true, + sec: true, + csc: true, + asin: true, + acos: true, + atan: true, + acot: true, + asec: true, + acsc: true, + sinh: true, + cosh: true, + tanh: true, + coth: true, + sech: true, + csch: true, + asinh: true, + acosh: true, + atanh: true, + acoth: true, + asech: true, + acsch: true }, // BigNumber @@ -95,30 +96,30 @@ const groups = [ // 'asinh': true, // 'atan': true, // 'atanh': true, - 'atan2': true, + atan2: true, // 'cbrt': true, // 'ceil': true, - 'clone': true, + clone: true, // 'cos': true, // 'cosh': true, // 'div': true, // 'exp': true, // 'floor': true, - 'hypot': true, + hypot: true, // 'ln': true, // 'log': true, - 'log2': true, - 'log10': true, - 'max': true, - 'min': true, + log2: true, + log10: true, + max: true, + min: true, // 'mod': true, // 'mul': true, - 'noConflict': true, + noConflict: true, // 'pow': true, - 'random': true, + random: true, // 'round': true, - 'set': true, - 'sign': true, + set: true, + sign: true, // 'sin': true, // 'sinh': true, // 'sqrt': true, @@ -127,164 +128,164 @@ const groups = [ // 'tanh': true, // 'trunc': true, - 'absoluteValue': true, - 'abs': true, - 'ceil': true, - 'comparedTo': true, - 'cmp': true, - 'cosine': true, - 'cos': true, - 'cubeRoot': true, - 'cbrt': true, - 'decimalPlaces': true, - 'dp': true, - 'dividedBy': true, - 'div': true, - 'dividedToIntegerBy': true, - 'divToInt': true, - 'equals': true, - 'eq': true, - 'floor': true, - 'greaterThan': true, - 'gt': true, - 'greaterThanOrEqualTo': true, - 'gte': true, - 'hyperbolicCosine': true, - 'cosh': true, - 'hyperbolicSine': true, - 'sinh': true, - 'hyperbolicTangent': true, - 'tanh': true, - 'inverseCosine': true, - 'acos': true, - 'inverseHyperbolicCosine': true, - 'acosh': true, - 'inverseHyperbolicSine': true, - 'asinh': true, - 'inverseHyperbolicTangent': true, - 'atanh': true, - 'inverseSine': true, - 'asin': true, - 'inverseTangent': true, - 'atan': true, - 'isFinite': true, - 'isInteger': true, - 'isInt': true, - 'isNaN': true, - 'isNegative': true, - 'isNeg': true, - 'isPositive': true, - 'isPos': true, - 'isZero': true, - 'lessThan': true, - 'lt': true, - 'lessThanOrEqualTo': true, - 'lte': true, - 'logarithm': true, - 'log': true, - 'minus': true, - 'sub': true, - 'modulo': true, - 'mod': true, - 'naturalExponential': true, - 'exp': true, - 'naturalLogarithm': true, - 'ln': true, - 'negated': true, - 'neg': true, - 'plus': true, - 'add': true, - 'precision': true, - 'sd': true, - 'round': true, - 'sine': true, - 'sin': true, - 'squareRoot': true, - 'sqrt': true, - 'tangent': true, - 'tan': true, - 'times': true, - 'mul': true, - 'toBinary': true, - 'toDecimalPlaces': true, - 'toDP': true, - 'toExponential': true, - 'toFixed': true, - 'toFraction': true, - 'toHexadecimal': true, - 'toHex': true, - 'toJSON': true, - 'toNearest': true, - 'toNumber': true, - 'toOctal': true, - 'toPower': true, - 'pow': true, - 'toPrecision': true, - 'toSignificantDigits': true, - 'toSD': true, - 'toString': true, - 'truncated': true, - 'trunc': true, - 'valueOf': true + absoluteValue: true, + abs: true, + ceil: true, + comparedTo: true, + cmp: true, + cosine: true, + cos: true, + cubeRoot: true, + cbrt: true, + decimalPlaces: true, + dp: true, + dividedBy: true, + div: true, + dividedToIntegerBy: true, + divToInt: true, + equals: true, + eq: true, + floor: true, + greaterThan: true, + gt: true, + greaterThanOrEqualTo: true, + gte: true, + hyperbolicCosine: true, + cosh: true, + hyperbolicSine: true, + sinh: true, + hyperbolicTangent: true, + tanh: true, + inverseCosine: true, + acos: true, + inverseHyperbolicCosine: true, + acosh: true, + inverseHyperbolicSine: true, + asinh: true, + inverseHyperbolicTangent: true, + atanh: true, + inverseSine: true, + asin: true, + inverseTangent: true, + atan: true, + isFinite: true, + isInteger: true, + isInt: true, + isNaN: true, + isNegative: true, + isNeg: true, + isPositive: true, + isPos: true, + isZero: true, + lessThan: true, + lt: true, + lessThanOrEqualTo: true, + lte: true, + logarithm: true, + log: true, + minus: true, + sub: true, + modulo: true, + mod: true, + naturalExponential: true, + exp: true, + naturalLogarithm: true, + ln: true, + negated: true, + neg: true, + plus: true, + add: true, + precision: true, + sd: true, + round: true, + sine: true, + sin: true, + squareRoot: true, + sqrt: true, + tangent: true, + tan: true, + times: true, + mul: true, + toBinary: true, + toDecimalPlaces: true, + toDP: true, + toExponential: true, + toFixed: true, + toFraction: true, + toHexadecimal: true, + toHex: true, + toJSON: true, + toNearest: true, + toNumber: true, + toOctal: true, + toPower: true, + pow: true, + toPrecision: true, + toSignificantDigits: true, + toSD: true, + toString: true, + truncated: true, + trunc: true, + valueOf: true }, // Fraction { - 'abs': true, - 'neg': true, - 'add': true, - 'sub': true, - 'mul': true, - 'div': true, - 'pow': true, - 'mod': true, - 'gcd': true, - 'lcm': true, - 'ceil': true, - 'floor': true, - 'round': true, - 'inverse': true, - 'equals': true, - 'compare': true, - 'valueOf': true, - 'toString': true, - 'toLatex': true, - 'toFraction': true, - 'toContinued': true, - 'clone': true + abs: true, + neg: true, + add: true, + sub: true, + mul: true, + div: true, + pow: true, + mod: true, + gcd: true, + lcm: true, + ceil: true, + floor: true, + round: true, + inverse: true, + equals: true, + compare: true, + valueOf: true, + toString: true, + toLatex: true, + toFraction: true, + toContinued: true, + clone: true }, // Array, DenseMatrix, SparseMatrix { - 'clone': true, - 'subset': true, - 'resize': true, - 'size': true, - 'map': true, - 'forEach': true, - 'toArray': true, - 'toJSON': true, - 'diagonal': true, - 'swapRows': true, - 'toString': true, - 'valueOf': true, - 'format': true + clone: true, + subset: true, + resize: true, + size: true, + map: true, + forEach: true, + toArray: true, + toJSON: true, + diagonal: true, + swapRows: true, + toString: true, + valueOf: true, + format: true }, // Node { - 'clone': true, - 'cloneDeep': true, - 'compile': true, - 'evaluate': true, - 'equals': true, - 'filter': true, - 'forEach': true, - 'map': true, - 'toString': true, - 'toTex': true, - 'transform': true, - 'traverse': true + clone: true, + cloneDeep: true, + compile: true, + evaluate: true, + equals: true, + filter: true, + forEach: true, + map: true, + toString: true, + toTex: true, + transform: true, + traverse: true } ]