Skip to content

Update dependency mathjs to v7#19

Open
staging-whitesource-for-github-com[bot] wants to merge 1 commit intomasterfrom
whitesource-remediate/mathjs-7.x
Open

Update dependency mathjs to v7#19
staging-whitesource-for-github-com[bot] wants to merge 1 commit intomasterfrom
whitesource-remediate/mathjs-7.x

Conversation

@staging-whitesource-for-github-com
Copy link
Copy Markdown

@staging-whitesource-for-github-com staging-whitesource-for-github-com bot commented Mar 29, 2025

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Type Update Change
mathjs (source) dependencies major 3.10.17.5.1

By merging this PR, the issue #5 will be automatically resolved and closed:

Severity CVSS Score Vulnerability Reachability
Critical Critical 9.8 CVE-2017-1001002
Critical Critical 9.8 CVE-2017-1001003
High High 7.3 CVE-2020-7743

Release Notes

josdejong/mathjs (mathjs)

v7.5.1

Compare Source

  • Fix object pollution vulnerability in math.config. Thanks Snyk.

v7.5.0

Compare Source

  • Function pickRandom now allows randomly picking elements from matrices
    with 2 or more dimensions instead of only from a vector, see #​1974.
    Thanks @​KonradLinkowski.

v7.4.0

Compare Source

  • Implemented support for passing a precision in functions ceil, floor,
    and fix, similar to round, see #​1967, #​1901. Thanks @​rnd-debug.
  • Implemented function rotationMatrix, see #​1160, #​1984. Thanks @​rnd-debug.
  • Implement a clear error message when using sqrtm with a matrix having
    more than two dimensions. Thanks @​KonradLinkowski.
  • Update dependency decimal.js to 10.2.1.

v7.3.0

Compare Source

  • Implemented functions usolveAll and lsolveAll, see #​1916. Thanks @​m93a.
  • Implemented support for units in functions std and variance, see #​1950.
    Thanks @​rnd-debug.
  • Implemented support for binary, octal, and hexadecimal notation in the
    expression parser, and implemented functions bin, oct, and hex for
    formatting. Thanks @​clnhlzmn.
  • Fix #​1964: inconsistent calculation of negative dividend modulo for
    BigNumber and Fraction. Thanks @​ovk.

v7.2.0

Compare Source

v7.1.0

Compare Source

  • Implement support for recursion (self-referencing) of typed-functions,
    new in typed-function@2.0.0. This fixes #​1885: functions which where
    extended with a new data type did not always work. Thanks @​nickewing.
  • Fix #​1899: documentation on expression trees still using old namespace
    math.expression.node.* instead of math.*.

v7.0.2

Compare Source

  • Fix #​1882: have DenseMatrix.resize and SparseMatrix.resize accept
    DenseMatrix and SparseMatrix as inputs too, not only Array.
  • Fix functions sum, prod, min, and max not throwing a conversion error
    when passing a single string, like sum("abc").

v7.0.1

Compare Source

  • Fix #​1844: clarify the documentation of function eigs. Thanks @​Lazersmoke.
  • Fix #​1855: Fix error in the documentation for math.nthRoots(x).
  • Fix #​1856: make the library robust against Object prototype pollution.

v7.0.0

Compare Source

Breaking changes:

  • Improvements in calculation of the dot product of complex values.
    The first argument is now conjugated. See #​1761. Thanks @​m93a.
  • Dropped official support for Node.js v8 which has reached end of life.
  • Removed all deprecation warnings introduced in v6.
    To upgrade smoothly from v5 to v7 or higher, upgrade to v6 first
    and resolve all deprecation warnings.

v6.6.5

Compare Source

  • Fix #​1834: value Infinity cannot be serialized and deserialized.
    This is solved now with a new math.replacer function used as
    JSON.stringify(value, math.replacer).
  • Fix #​1842: value Infinity not turned into the latex symbol \\infty.

v6.6.4

Compare Source

  • Fix published files containing Windows line endings (CRLF instead of LF).

v6.6.3

Compare Source

  • Fix #​1813: bug in engineering notation for numbers of function format,
    sometimes resulting in needless trailing zeros.
  • Fix #​1808: methods .toNumber() and .toNumeric() not working on a
    unitless unit.
  • Fix #​1645: not being able to use named operators mod, and, not, or,
    xor, to, in as object keys. Thanks @​Veeloxfire.
  • Fix eigs not using config.epsilon.

v6.6.2

Compare Source

  • Fix #​1789: Function eigs not calculating with BigNumber precision
    when input contains BigNumbers.
  • Run the build script during npm prepare, so you can use the library
    directly when installing directly from git. See #​1751. Thanks @​cinderblock.

v6.6.1

Compare Source

v6.6.0

Compare Source

  • Implemented function eigs, see #​1705, #​542 #​1175. Thanks @​arkajitmandal.
  • Fixed #​1727: validate matrix size when creating a DenseMatrix using
    fromJSON.
  • Fixed DenseMatrix.map copying the size and datatype from the original
    matrix instead of checking the returned dimensions and type of the callback.
  • Add a caret to dependencies (like) ^1.2.3) to allow downstream updates
    without having to await a new release of mathjs.

v6.5.0

Compare Source

v6.4.0

Compare Source

  • Extended function dimension with support for n-dimensional points.
    Thanks @​Veeloxfire.

v6.3.0

Compare Source

  • Improved performance of factorial for BigNumber up to a factor two,
    see #​1687. Thanks @​kmdrGroch.

v6.2.5

Compare Source

  • Fixed IndexNode using a hardcoded, one-based implementation of index,
    making it impossible to instantiate a zero-based version of the expression
    parser. See #​782.

v6.2.4

Compare Source

v6.2.3

Compare Source

  • Fixed #​1640: function mean not working for units. Thanks @​clintonc.
  • Fixed #​1639: function min listed twice in the "See also" section of the
    embedded docs of function std.
  • Improved performance of isPrime, see #​1641. Thanks @​arguiot.

v6.2.2

Compare Source

  • Fixed methods map and clone not copying the dotNotation property of
    IndexNode. Thanks @​rianmcguire.
  • Fixed a typo in the documentation of toHTML. Thanks @​maytanthegeek.
  • Fixed #​1615: error in the docs of isNumeric.
  • Fixed #​1628: Cannot call methods on empty strings or numbers with value 0.

v6.2.1

Compare Source

  • Fixed #​1606: function format not working for expressions.

v6.2.0

Compare Source

  • Improved performance of combinationsWithRep. Thanks @​waseemyusuf.
  • Add unit aliases bit and byte.
  • Fix docs referring to bit and byte instead of bits and bytes.
  • Updated dependency typed-function@1.1.1.

v6.1.0

Compare Source

v6.0.4

Compare Source

  • Fixed #​1554, #​1565: ES Modules where not transpiled to ES5, giving issues on
    old browsers. Thanks @​mockdeep for helping to find a solution.

v6.0.3

Compare Source

  • Add unpkg and jsdelivr fields in package.json pointing to UMD build.
    Thanks @​tmcw.
  • Fix #​1550: nested user defined function not receiving variables of an
    outer user defined function.

v6.0.2

Compare Source

  • Fix not being able to set configuration after disabling function import
    (regression since v6.0.0).

v6.0.1

Compare Source

  • Fix function reference not published in npm library.
  • Fix function evaluate and parse missing in generated docs.

v6.0.0

Compare Source

!!! BE CAREFUL: BREAKING CHANGES !!!

Most notable changes
  1. Full support for ES modules. Support for tree-shaking out of the box.

    Load all functions:

    import * as math from 'mathjs'

    Use a few functions:

    import { add, multiply } from 'mathjs'

    Load all functions with custom configuration:

    import { create, all } from 'mathjs'
    const config = { number: 'BigNumber' }
    const math = create(all, config)

    Load a few functions with custom configuration:

    import { create, addDependencies, multiplyDependencies } from 'mathjs'
    const config = { number: 'BigNumber' }
    const { add, multiply } = create({
      addDependencies,
      multiplyDependencies
    }, config)
  2. Support for lightweight, number-only implementations of all functions:

    import { add, multiply } from 'mathjs/number'
    
  3. New dependency injection solution used under the hood.

Breaking changes
  • Node 6 is no longer supported.

  • Functions config and import are not available anymore in the global
    context:

    // v5
    import * as mathjs from 'mathjs'
    mathjs.config(...) // error in v6.0.0
    mathjs.import(...) // error in v6.0.0

    Instead, create your own mathjs instance and pass config and imports
    there:

    // v6
    import { create, all } from 'mathjs'
    const config = { number: 'BigNumber' }
    const mathjs = create(all, config)
    mathjs.import(...)
  • Renamed function typeof to typeOf, var to variance,
    and eval to evaluate. (the old function names are reserved keywords
    which can not be used as a variable name).

  • Deprecated the Matrix.storage function. Use math.matrix instead to create
    a matrix.

  • Deprecated function math.expression.parse, use math.parse instead.
    Was used before for example to customize supported characters by replacing
    math.parse.isAlpha.

  • Moved all classes like math.type.Unit and math.expression.Parser to
    math.Unit and math.Parser respectively.

  • Fixed #​1428: transform iterating over replaced nodes. New behavior
    is that it stops iterating when a node is replaced.

  • Dropped support for renaming factory functions when importing them.

  • Dropped fake BigNumber support of function erf.

  • Removed all index.js files used to load specific functions instead of all, like:

    // v5
    // ... set up empty instance of mathjs, then load a set of functions:
    math.import(require('mathjs/lib/function/arithmetic'))
    

    Individual functions are now loaded simply like:

    // v6
    import { add, multiply } from 'mathjs'

    To set a specific configuration on the functions:

    // v6
    import { create, addDependencies, multiplyDependencies } from 'mathjs'
    const config = { number: 'BigNumber' }
    const math = create({ addDependencies, multiplyDependencies }, config)

    See example advanced/custom_loading.js.

  • Updated the values of all physical units to their latest official values.
    See #​1529. Thanks @​ericman314.

Non breaking changes
  • Implemented units t, tonne, bel, decibel, dB, and prefixes
    for candela. Thanks @​mcvladthegoat.
  • Fixed epsilon setting being applied globally to Complex numbers.
  • Fix math.simplify('add(2, 3)') throwing an error.
  • Fix #​1530: number formatting first applied lowerExp and upperExp
    and after that rounded the value instead of the other way around.
  • Fix #​1473: remove 'use strict' in every file, not needed anymore.

v5.10.3

Compare Source

  • Fixed dependency del being a dependency instead of devDependency.

v5.10.2

Compare Source

  • Fix #​1515, #​1516, #​1517: broken package due to a naming conflict in
    the build folder of a util file typeOf.js and typeof.js.
    Solved by properly cleaning all build folders before building.

v5.10.1

Compare Source

  • Fix #​1512: format using notation engineering can give wrong results
    when the value has less significant digits than the number of digits in
    the output.

v5.10.0

Compare Source

  • Fix lib/header.js not having filled in date and version. Thanks @​kevjin.
  • Upgraded dependency decimal.js@10.2.0, fixing an issue on node.js 12.

v5.9.0

Compare Source

  • Implemented functions row and column (see #​1413). Thanks @​SzechuanSage.
  • Fixed #​1459: engineering notation of function format not available
    for BigNumber.
  • Fixed #​1465: node.toHTML() not correct for unary operators like
    factorial.

v5.8.0

Compare Source

  • Implemented new function apply. Thanks @​bnlcas.
  • Implemented passing an optional dimension argument to std and var.
    Thanks @​bnlcas.

v5.7.0

Compare Source

v5.6.0

Compare Source

  • Upgrade decimal.js to v10.1.1 (#​1421).
  • Fixed #​1418: missing whitespace when stringifying an expression
    containing "not".

v5.5.0

Compare Source

  • Fixed #​1401: methods map and forEach of SparseMatrix not working
    correctly when indexes are unordered.
  • Fixed #​1404: inconsistent rounding of negative numbers.
  • Upgrade tiny-emitter to v2.1.0 (#​1397).

v5.4.2

Compare Source

  • Fixed math.format not working for BigNumbers with a precision above
    1025 digits (see #​1385). Thanks @​ericman314.
  • Fixed incorrect LaTeX output of RelationalNode. Thanks @​rianmcguire.
  • Fixed a bug the methods map, forEach, traverse, and transform
    of FunctionNode.

v5.4.1

Compare Source

  • Fix #​1378: negative bignumbers not formatted correctly.
  • Upgrade fraction.js to version 4.0.12 (#​1369).

v5.4.0

Compare Source

  • Extended sum.js to accept a dimension input to calculate the sum over a
    specific axis. Thanks @​bnlcas.
  • Fix #​1328: objects can't be written multi-line. Thanks @​GHolk.
  • Remove side effects caused by Unit.format and Unit.toString,
    making changes to the unit on execution. Thanks @​ericman314.

v5.3.1

Compare Source

v5.3.0

Compare Source

v5.2.3

Compare Source

  • Fixed #​1293: non-unicode characters in escape-latex giving issues in some
    specific cases. Thanks @​dangmai.
  • Fixed incorrect LaTeX output of function bitNot, see #​1299. Thanks @​FSMaxB.
  • Fixed #​1304: function pow not supporting inputs pow(Unit, BigNumber).
  • Upgraded dependencies (escape-latex@1.2.0)

v5.2.2

Compare Source

v5.2.1

Compare Source

  • Fixed unit rod being defined as 5.02921 instead of 5.0292.
    Thanks @​ericman314.
  • Upgraded dependencies (fraction.js@4.0.10)
  • Upgraded devDependencies (@babel/core@7.1.2, nyc@13.1.0,
    webpack@4.21.0).

v5.2.0

Compare Source

  • Feat: Add amp-hour charge unit Ah (#​3617). Thanks @​adrfantini.
  • Feat: #​3595 implement num and den functions returning the parts of
    a fraction (#​3605). Thanks @​AnslemHack.
  • Fix: Provide TypeScript types for [and/or]TransformDependencies (#​3639).
    Thanks @​NilsDietrich.
  • Fix: two security vulnerabilities that allowed executing arbitrary JavaScript
    via the expression parser. Thanks @​CykuTW for finding and reporting them.

v5.1.2

Compare Source

  • Fixed a typo in the docs of parse. Thanks @​mathiasvr.
  • Fixed #​1222: a typo in the docs of subset.
  • Fixed #​1236: quantileSeq has inconsistent return.
  • Fixed #​1237: norm sometimes returning a complex number instead of
    number.
  • Upgraded dependencies (fraction.js@4.0.9)
  • Upgraded devDependencies (babel@7, karma-webpack@3.0.4,
    nyc@13.0.1, standard@12.0.0, uglify-js@3.4.9, webpack@4.17.2)

v5.1.1

Compare Source

v5.1.0

Compare Source

v5.0.4

Compare Source

  • Strongly improved the performance of functions factorial for numbers.
    This improves performance of functions gamma, permutation, and
    combination too. See #​1170. Thanks @​honeybar.
  • Strongly improved the performance of function reshape, thanks to a
    friend of @​honeybar.

v5.0.3

Compare Source

  • Fixed many functions (for example add and subtract) not working
    with matrices having a datatype defined.
  • Fixed #​1147: bug in format with engineering notation in outputting
    the correct number of significant figures. Thanks @​ericman314.
  • Fixed #​1162: transform functions not being cleaned up when overriding
    it by importing a factory function with the same name.
  • Fixed broken links in the documentation. Thanks @​stropitek.
  • Refactored the code of parse into a functional approach.
    Thanks @​harrysarson.
  • Changed decimal.js import to ES6. Thanks @​weinshel.

v5.0.2

Compare Source

  • Fixed #​1136: rocket trajectory example broken (since v4.0.0).
  • Fixed #​1137: simplify unnecessarily replacing implicit multiplication with
    explicit multiplication.
  • Fixed #​1146: rationalize throwing exceptions for some input with decimals.
    Thanks @​maruta.
  • Fixed #​1088: function arguments not being passed to rawArgs functions.
  • Fixed advanced example add_new_datatypes.
  • Fixed mathjs core constants not working without complex numbers.
    Thanks @​ChristopherChudzicki.
  • Fixed a broken link in the documentation on units. Thanks @​stropitek.
  • Upgraded dependencies (typed-function@1.0.4, complex.js@2.0.11).
  • Upgraded devDependencies (babel-loader@7.1.5, uglify-js@3.4.3,
    expr-eval@1.2.2, webpack@4.15.1).

v5.0.1

Compare Source

  • Improved error messaging when converting units. Thanks @​gap777.
  • Upgraded devDependencies (kerma, uglify-js, webpack).

v5.0.0

Compare Source

!!! BE CAREFUL: BREAKING CHANGES !!!

v4.4.2

Compare Source

  • Drastically improved the performance of det. Thanks @​ericman314.
  • Fixed #​1065, #​1121: Fixed wrong documentation of function
    compareNatural and clarified the behavior for strings.
  • Fixed #​1122 a regression in function inv (since v4.4.1).
    Thanks @​ericman314.

v4.4.1

Compare Source

v4.4.0

Compare Source

v4.3.0

Compare Source

v4.2.2

Compare Source

  • Fixed calculating the Frobenius norm of complex matrices correctly,
    see #​1098. Thanks @​jackschmidt.
  • Fixed #​1076: cannot use mathjs in React VR by updating to
    escape-latex@1.0.3.

v4.2.1

Compare Source

  • Fix: #​3377 remove redundant dependency @lambdatest/node-tunnel.

v4.2.0

Compare Source

v4.1.2

Compare Source

  • Fixed #​1082: implemented support for unit plurals decades, centuries,
    and millennia.
  • Fixed #​1083: units decade and watt having a wrong name when stringifying.
    Thanks @​ericman314.

v4.1.1

Compare Source

  • Fixed #​1063: derivative not working when resolving a variable with unary
    minus like math.derivative('-x', 'x').

v4.1.0

Compare Source

  • Feat: implement bigint support in functions log, log2, log10,
    larger, smaller, max, min (#​3345). Thanks @​gwhitney.
  • Fix: #​3342 hexadecimal input not turned into a bigint (#​3348).
  • Fix randomInt() not working (#​3345).
  • Docs: fixed description of sign in the embedded docs (#​3338).
    Thanks @​witer33.

v4.0.1

Compare Source

v4.0.0

Compare Source

!!! BE CAREFUL: BREAKING CHANGES !!!

  • Feat: Upgrade to fraction.js@5, using bigint under the hood (#​3283).
  • Feat: Implement support for Unit in functions ceil, floor, and fix.
    Possible breaking changes in the type definitions of arrays and matrices
    due to the introduction of generics (#​3269). Thanks @​orelbn.
  • Feat: Implement support for log(x: Fraction, base: Fraction).
  • Fix: #​3301 precedence of % (mod) being higher than * and / (#​3311).
    Thanks @​nkumawat34.
  • Fix: #​3222 prevent math.import(...) from overriding units unless you
    specify { override: true } (#​3225).
  • Fix: #​3219 let functions dotDivide, dotPow, bitXor, xor, equal,
    larger, largerEq, smaller, smallerEq, and unequal return a sparse
    matrix when the input is two sparse matrices (#​3307). Thanks @​Aakash-Rana.
  • Fix: Improve type definitions of arrays (#​3306). Thanks @​orelbn.

v3.20.2

Compare Source

  • Upgraded to typed-function@0.10.7 (bug-fix release).
  • Fixed option implicit not being copied from an OperatorNode
    when applying function map. Thanks @​HarrySarson.
  • Fixed #​995: spaces and underscores not property being escaped
    in toTex(). Thanks @​FSMaxB.

v3.20.1

Compare Source

v3.20.0

Compare Source

  • Implement support for 3 or more arguments for operators + and * in
    derivative. Thanks @​HarrySarson. See #​1002.
  • Fixed simplify evalution of simplify of functions with more than two
    arguments wrongly: simplify('f(x, y, z)') evaluated tof(f(x, y), z)instead off(x, y, z)`. Thanks @​joelhoover.
  • Fixed simplify throwing an error in some cases when simplifying unknown
    functions, for example simplify('f(4)'). Thanks @​joelhoover.
  • Fixed #​1013: simplify wrongly simplifing some expressions containing unary
    minus, like 0 - -x. Thanks @​joelhoover.
  • Fixed an error in an example in the documentation of xor. Thanks @​denisx.

v3.19.0

Compare Source

  • Extended functions distance and intersect with support for BigNumbers.
    Thanks @​ovk.
  • Improvements in function simplify: added a rule that allows combining
    of like terms in embedded quantities. Thanks @​joelhoover.

v3.18.1

Compare Source

  • Fixed #​998: An issue with simplifying an expression containing a subtraction.
    Thanks @​firepick1.

v3.18.0

Compare Source

  • Implemented function rationalize. Thanks @​paulobuchsbaum.

  • Upgraded dependencies:

    decimal.js    7.2.3  →  9.0.1 (no breaking changes affecting mathjs)
    fraction.js   4.0.2  →  4.0.4
    tiny-emitter  2.0.0  →  2.0.2
    

@staging-whitesource-for-github-com staging-whitesource-for-github-com bot added the security fix Security fix generated by Mend label Mar 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security fix Security fix generated by Mend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants