mathjs 12.4.1 → 12.4.2
Sign up to get free protection for your applications and to get access to all the features.
- package/HISTORY.md +9 -0
- package/lib/browser/math.js +1 -1
- package/lib/browser/math.js.LICENSE.txt +2 -2
- package/lib/browser/math.js.map +1 -1
- package/lib/cjs/core/create.js +3 -3
- package/lib/cjs/defaultInstance.js +1 -1
- package/lib/cjs/entry/allFactoriesAny.js +1 -1
- package/lib/cjs/entry/allFactoriesNumber.js +1 -1
- package/lib/cjs/expression/node/AccessorNode.js +2 -3
- package/lib/cjs/expression/node/ArrayNode.js +2 -3
- package/lib/cjs/expression/node/AssignmentNode.js +2 -3
- package/lib/cjs/expression/node/BlockNode.js +2 -3
- package/lib/cjs/expression/node/ConditionalNode.js +2 -3
- package/lib/cjs/expression/node/ConstantNode.js +2 -3
- package/lib/cjs/expression/node/FunctionAssignmentNode.js +2 -3
- package/lib/cjs/expression/node/FunctionNode.js +5 -6
- package/lib/cjs/expression/node/IndexNode.js +2 -3
- package/lib/cjs/expression/node/Node.js +1 -2
- package/lib/cjs/expression/node/ObjectNode.js +2 -3
- package/lib/cjs/expression/node/OperatorNode.js +2 -3
- package/lib/cjs/expression/node/ParenthesisNode.js +2 -3
- package/lib/cjs/expression/node/RangeNode.js +2 -3
- package/lib/cjs/expression/node/RelationalNode.js +2 -3
- package/lib/cjs/expression/node/SymbolNode.js +2 -3
- package/lib/cjs/function/utils/isNaN.js +5 -3
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/utils/map.js +2 -4
- package/lib/cjs/utils/object.js +0 -6
- package/lib/cjs/utils/snapshot.js +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/core/create.js +3 -3
- package/lib/esm/expression/node/FunctionNode.js +3 -3
- package/lib/esm/function/utils/isNaN.js +1 -3
- package/lib/esm/utils/object.js +0 -3
- package/lib/esm/version.js +1 -1
- package/package.json +15 -15
- package/types/index.d.ts +4 -0
@@ -9,7 +9,7 @@ import { defaultTemplate, latexFunctions } from '../../utils/latex.js';
|
|
9
9
|
var name = 'FunctionNode';
|
10
10
|
var dependencies = ['math', 'Node', 'SymbolNode'];
|
11
11
|
export var createFunctionNode = /* #__PURE__ */factory(name, dependencies, _ref => {
|
12
|
-
var
|
12
|
+
var _FunctionNode;
|
13
13
|
var {
|
14
14
|
math,
|
15
15
|
Node,
|
@@ -456,13 +456,13 @@ export var createFunctionNode = /* #__PURE__ */factory(name, dependencies, _ref
|
|
456
456
|
return this.type + ':' + this.name;
|
457
457
|
}
|
458
458
|
}
|
459
|
-
|
459
|
+
_FunctionNode = FunctionNode;
|
460
460
|
_defineProperty(FunctionNode, "name", name);
|
461
461
|
_defineProperty(FunctionNode, "onUndefinedFunction", function (name) {
|
462
462
|
throw new Error('Undefined function ' + name);
|
463
463
|
});
|
464
464
|
_defineProperty(FunctionNode, "fromJSON", function (json) {
|
465
|
-
return new
|
465
|
+
return new _FunctionNode(json.fn, json.args);
|
466
466
|
});
|
467
467
|
return FunctionNode;
|
468
468
|
}, {
|
@@ -50,8 +50,6 @@ export var createIsNaN = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
50
50
|
Unit: function Unit(x) {
|
51
51
|
return Number.isNaN(x.value);
|
52
52
|
},
|
53
|
-
'Array | Matrix':
|
54
|
-
return deepMap(x, Number.isNaN);
|
55
|
-
}
|
53
|
+
'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))
|
56
54
|
});
|
57
55
|
});
|
package/lib/esm/utils/object.js
CHANGED
@@ -365,9 +365,6 @@ export function pickShallow(object, properties) {
|
|
365
365
|
}
|
366
366
|
return copy;
|
367
367
|
}
|
368
|
-
export function values(object) {
|
369
|
-
return Object.keys(object).map(key => object[key]);
|
370
|
-
}
|
371
368
|
|
372
369
|
// helper function to test whether a string contains a path like 'user.name'
|
373
370
|
function isPath(str) {
|
package/lib/esm/version.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "mathjs",
|
3
|
-
"version": "12.4.
|
3
|
+
"version": "12.4.2",
|
4
4
|
"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.",
|
5
5
|
"author": "Jos de Jong <wjosdejong@gmail.com> (https://github.com/josdejong)",
|
6
6
|
"homepage": "https://mathjs.org",
|
@@ -25,7 +25,7 @@
|
|
25
25
|
"unit"
|
26
26
|
],
|
27
27
|
"dependencies": {
|
28
|
-
"@babel/runtime": "^7.24.
|
28
|
+
"@babel/runtime": "^7.24.4",
|
29
29
|
"complex.js": "^2.1.1",
|
30
30
|
"decimal.js": "^10.4.3",
|
31
31
|
"escape-latex": "^1.2.0",
|
@@ -36,36 +36,36 @@
|
|
36
36
|
"typed-function": "^4.1.1"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@babel/core": "7.24.
|
40
|
-
"@babel/plugin-transform-object-assign": "7.
|
41
|
-
"@babel/plugin-transform-runtime": "7.24.
|
42
|
-
"@babel/preset-env": "7.24.
|
39
|
+
"@babel/core": "7.24.4",
|
40
|
+
"@babel/plugin-transform-object-assign": "7.24.1",
|
41
|
+
"@babel/plugin-transform-runtime": "7.24.3",
|
42
|
+
"@babel/preset-env": "7.24.4",
|
43
43
|
"@babel/register": "7.23.7",
|
44
44
|
"@types/assert": "1.5.10",
|
45
45
|
"@types/mocha": "10.0.6",
|
46
|
-
"@typescript-eslint/eslint-plugin": "7.
|
47
|
-
"@typescript-eslint/parser": "7.
|
46
|
+
"@typescript-eslint/eslint-plugin": "7.7.1",
|
47
|
+
"@typescript-eslint/parser": "7.7.1",
|
48
48
|
"assert": "2.1.0",
|
49
49
|
"babel-loader": "9.1.3",
|
50
50
|
"benchmark": "2.1.4",
|
51
51
|
"c8": "9.1.0",
|
52
52
|
"codecov": "3.8.3",
|
53
|
-
"core-js": "3.
|
53
|
+
"core-js": "3.37.0",
|
54
54
|
"del": "6.1.1",
|
55
55
|
"dtslint": "4.2.1",
|
56
56
|
"eslint": "8.57.0",
|
57
57
|
"eslint-config-prettier": "9.1.0",
|
58
58
|
"eslint-config-standard": "17.1.0",
|
59
59
|
"eslint-plugin-import": "2.29.1",
|
60
|
-
"eslint-plugin-mocha": "10.4.
|
60
|
+
"eslint-plugin-mocha": "10.4.3",
|
61
61
|
"eslint-plugin-n": "16.6.2",
|
62
62
|
"eslint-plugin-prettier": "5.1.3",
|
63
63
|
"eslint-plugin-promise": "6.1.1",
|
64
|
-
"expect-type": "0.
|
64
|
+
"expect-type": "0.19.0",
|
65
65
|
"expr-eval": "2.0.2",
|
66
66
|
"fancy-log": "2.0.0",
|
67
67
|
"glob": "8.1.0",
|
68
|
-
"gulp": "
|
68
|
+
"gulp": "5.0.0",
|
69
69
|
"gulp-babel": "8.0.0",
|
70
70
|
"handlebars": "4.7.8",
|
71
71
|
"jsep": "1.3.8",
|
@@ -76,7 +76,7 @@
|
|
76
76
|
"karma-mocha-reporter": "2.2.5",
|
77
77
|
"karma-webpack": "5.0.1",
|
78
78
|
"mkdirp": "3.0.1",
|
79
|
-
"mocha": "10.
|
79
|
+
"mocha": "10.4.0",
|
80
80
|
"mocha-junit-reporter": "2.2.1",
|
81
81
|
"ndarray": "1.0.19",
|
82
82
|
"ndarray-determinant": "1.0.0",
|
@@ -89,8 +89,8 @@
|
|
89
89
|
"process": "0.11.10",
|
90
90
|
"sylvester": "0.0.21",
|
91
91
|
"ts-node": "10.9.2",
|
92
|
-
"typescript": "5.4.
|
93
|
-
"webpack": "5.
|
92
|
+
"typescript": "5.4.5",
|
93
|
+
"webpack": "5.91.0",
|
94
94
|
"zeros": "1.0.0"
|
95
95
|
},
|
96
96
|
"type": "module",
|
package/types/index.d.ts
CHANGED
@@ -1036,7 +1036,9 @@ export interface MathJsInstance extends MathJsFactory {
|
|
1036
1036
|
* @returns Sum of x and y
|
1037
1037
|
*/
|
1038
1038
|
add<T extends MathType>(x: T, y: T): T
|
1039
|
+
add<T extends MathType>(...values: T[]): T
|
1039
1040
|
add(x: MathType, y: MathType): MathType
|
1041
|
+
add(...values: MathType[]): MathType
|
1040
1042
|
|
1041
1043
|
/**
|
1042
1044
|
* Calculate the cubic root of a value.
|
@@ -1283,6 +1285,8 @@ export interface MathJsInstance extends MathJsFactory {
|
|
1283
1285
|
multiply(x: Unit, y: Unit): Unit
|
1284
1286
|
multiply(x: number, y: number): number
|
1285
1287
|
multiply(x: MathType, y: MathType): MathType
|
1288
|
+
multiply<T extends MathType>(...values: T[]): T
|
1289
|
+
multiply(...values: MathType[]): MathType
|
1286
1290
|
|
1287
1291
|
/**
|
1288
1292
|
* Calculate the norm of a number, vector or matrix. The second
|