Skip to content

Commit

Permalink
Merge branch 'develop' into followup-3197
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong authored Jun 28, 2024
2 parents 94e3f35 + 4319616 commit 7ceecba
Show file tree
Hide file tree
Showing 8 changed files with 922 additions and 1,190 deletions.
1 change: 1 addition & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
],
"plugins": [
"@babel/plugin-transform-object-assign",
"@babel/plugin-transform-optional-catch-binding",
"@babel/plugin-transform-runtime"
],
"ignore": [
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -248,5 +248,6 @@ Rohil Shah <shah5963@gmail.com>
Laurent Gérin <41303636+lgerin@users.noreply.github.com>
Adam Jones <domdomegg+git@gmail.com>
Lucas Eng <lucaseng19@gmail.com>
Orel Ben Neriah <77707952+orelbn@users.noreply.github.com>

# Generated by tools/update-authors.js
688 changes: 219 additions & 469 deletions HISTORY.md

Large diffs are not rendered by default.

1,348 changes: 646 additions & 702 deletions package-lock.json

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mathjs",
"version": "13.0.0",
"version": "13.0.1",
"description": "Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices.",
"author": "Jos de Jong <wjosdejong@gmail.com> (https://github.com/josdejong)",
"homepage": "https://mathjs.org",
Expand All @@ -25,7 +25,7 @@
"unit"
],
"dependencies": {
"@babel/runtime": "^7.24.6",
"@babel/runtime": "^7.24.7",
"complex.js": "^2.1.1",
"decimal.js": "^10.4.3",
"escape-latex": "^1.2.0",
Expand All @@ -36,19 +36,20 @@
"typed-function": "^4.2.1"
},
"devDependencies": {
"@babel/core": "7.24.6",
"@babel/plugin-transform-object-assign": "7.24.6",
"@babel/plugin-transform-runtime": "7.24.6",
"@babel/preset-env": "7.24.6",
"@babel/core": "7.24.7",
"@babel/plugin-transform-object-assign": "7.24.7",
"@babel/plugin-transform-optional-catch-binding": "7.24.7",
"@babel/plugin-transform-runtime": "7.24.7",
"@babel/preset-env": "7.24.7",
"@babel/register": "7.24.6",
"@types/assert": "1.5.10",
"@types/mocha": "10.0.6",
"@typescript-eslint/eslint-plugin": "7.11.0",
"@typescript-eslint/parser": "7.11.0",
"@types/mocha": "10.0.7",
"@typescript-eslint/eslint-plugin": "7.14.1",
"@typescript-eslint/parser": "7.14.1",
"assert": "2.1.0",
"babel-loader": "9.1.3",
"benchmark": "2.1.4",
"c8": "9.1.0",
"c8": "10.1.2",
"codecov": "3.8.3",
"core-js": "3.37.1",
"del": "7.1.0",
Expand All @@ -64,7 +65,7 @@
"expect-type": "0.19.0",
"expr-eval": "2.0.2",
"fancy-log": "2.0.0",
"glob": "10.4.1",
"glob": "10.4.2",
"gulp": "5.0.0",
"gulp-babel": "8.0.0",
"handlebars": "4.7.8",
Expand All @@ -76,7 +77,7 @@
"karma-mocha-reporter": "2.2.5",
"karma-webpack": "5.0.1",
"mkdirp": "3.0.1",
"mocha": "10.4.0",
"mocha": "10.5.2",
"mocha-junit-reporter": "2.2.1",
"ndarray": "1.0.19",
"ndarray-determinant": "1.0.0",
Expand All @@ -85,13 +86,13 @@
"ndarray-pack": "1.2.1",
"numericjs": "1.2.6",
"pad-right": "0.2.2",
"prettier": "3.2.5",
"prettier": "3.3.2",
"process": "0.11.10",
"sinon": "18.0.0",
"sylvester": "0.0.21",
"ts-node": "10.9.2",
"typescript": "5.4.5",
"webpack": "5.91.0",
"typescript": "5.5.2",
"webpack": "5.92.1",
"zeros": "1.0.0"
},
"type": "module",
Expand Down Expand Up @@ -166,4 +167,4 @@
"url": "https://github.com/josdejong/mathjs/issues"
},
"sideEffects": false
}
}
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const version = '13.0.0'
export const version = '13.0.1'
// Note: This file is automatically generated when building math.js.
// Changes made in this file will be overwritten.
5 changes: 5 additions & 0 deletions test/typescript-tests/testTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1119,10 +1119,15 @@ Expressions examples
const _x = parser.get('x')
const f = parser.get('f')
const _y = parser.getAll()
const _z = parser.getAllAsMap()
const _g = f(3, 3)

parser.set('h', 500)
assert.strictEqual(parser.get('h'), 500)
assert.strictEqual(parser.evaluate('h'), 500)
parser.set('hello', (name: string) => `hello, ${name}!`)
parser.remove('h')
assert.strictEqual(parser.get('h'), undefined)
}

// clear defined functions and variables
Expand Down
34 changes: 32 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4292,14 +4292,44 @@ export interface MathNode {
}

export interface Parser {
/**
* Evaluate an expression. Returns the result of the expression.
* @param expr The expression to evaluate
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
evaluate(expr: string | string[]): any
/**
* Retrieve a variable or function from the parser’s scope.
* @param name The name of the variable or function to be retrieved
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
get(variable: string): any
get(name: string): any
/**
* Retrieve an object with all defined variables in the parser’s scope.
* @returns An object with all defined variables
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
getAll(): { [key: string]: any }
/**
* Retrieve a map with all defined variables in the parser’s scope.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
set: (variable: string, value: any) => void
getAllAsMap(): Map<string, any>
/**
* Set a variable or function in the parser’s scope.
* @param name The name of the variable or function to be set
* @param value The value of the variable or function to be set
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
set: (name: string, value: any) => void
/**
* Remove a variable or function from the parser’s scope.
* @param name The name of the variable or function to be removed
*/
remove: (name: string) => void
/**
* Completely clear the parser’s scope.
*/
clear: () => void
}

Expand Down

0 comments on commit 7ceecba

Please sign in to comment.