mathjs 13.0.2 → 13.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/function/import.js +1 -1
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/type/unit/Unit.js +57 -114
- package/lib/cjs/version.js +1 -1
- package/lib/esm/core/function/import.js +1 -1
- package/lib/esm/type/unit/Unit.js +57 -114
- package/lib/esm/version.js +1 -1
- package/package.json +11 -11
- package/types/index.d.ts +51 -7
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "mathjs",
|
3
|
-
"version": "13.0.
|
3
|
+
"version": "13.0.3",
|
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.8",
|
29
29
|
"complex.js": "^2.1.1",
|
30
30
|
"decimal.js": "^10.4.3",
|
31
31
|
"escape-latex": "^1.2.0",
|
@@ -36,16 +36,16 @@
|
|
36
36
|
"typed-function": "^4.2.1"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@babel/core": "7.24.
|
39
|
+
"@babel/core": "7.24.9",
|
40
40
|
"@babel/plugin-transform-object-assign": "7.24.7",
|
41
41
|
"@babel/plugin-transform-optional-catch-binding": "7.24.7",
|
42
42
|
"@babel/plugin-transform-runtime": "7.24.7",
|
43
|
-
"@babel/preset-env": "7.24.
|
43
|
+
"@babel/preset-env": "7.24.8",
|
44
44
|
"@babel/register": "7.24.6",
|
45
45
|
"@types/assert": "1.5.10",
|
46
46
|
"@types/mocha": "10.0.7",
|
47
|
-
"@typescript-eslint/eslint-plugin": "7.
|
48
|
-
"@typescript-eslint/parser": "7.
|
47
|
+
"@typescript-eslint/eslint-plugin": "7.16.1",
|
48
|
+
"@typescript-eslint/parser": "7.16.1",
|
49
49
|
"assert": "2.1.0",
|
50
50
|
"babel-loader": "9.1.3",
|
51
51
|
"benchmark": "2.1.4",
|
@@ -60,16 +60,16 @@
|
|
60
60
|
"eslint-plugin-import": "2.29.1",
|
61
61
|
"eslint-plugin-mocha": "10.4.3",
|
62
62
|
"eslint-plugin-n": "16.6.2",
|
63
|
-
"eslint-plugin-prettier": "5.1
|
63
|
+
"eslint-plugin-prettier": "5.2.1",
|
64
64
|
"eslint-plugin-promise": "6.4.0",
|
65
65
|
"expect-type": "0.19.0",
|
66
66
|
"expr-eval": "2.0.2",
|
67
67
|
"fancy-log": "2.0.0",
|
68
|
-
"glob": "
|
68
|
+
"glob": "11.0.0",
|
69
69
|
"gulp": "5.0.0",
|
70
70
|
"gulp-babel": "8.0.0",
|
71
71
|
"handlebars": "4.7.8",
|
72
|
-
"jsep": "1.3.
|
72
|
+
"jsep": "1.3.9",
|
73
73
|
"karma": "6.4.3",
|
74
74
|
"karma-browserstack-launcher": "1.6.0",
|
75
75
|
"karma-firefox-launcher": "2.1.3",
|
@@ -86,13 +86,13 @@
|
|
86
86
|
"ndarray-pack": "1.2.1",
|
87
87
|
"numericjs": "1.2.6",
|
88
88
|
"pad-right": "0.2.2",
|
89
|
-
"prettier": "3.3.
|
89
|
+
"prettier": "3.3.3",
|
90
90
|
"process": "0.11.10",
|
91
91
|
"sinon": "18.0.0",
|
92
92
|
"sylvester": "0.0.21",
|
93
93
|
"ts-node": "10.9.2",
|
94
94
|
"typescript": "5.5.3",
|
95
|
-
"webpack": "5.
|
95
|
+
"webpack": "5.93.0",
|
96
96
|
"zeros": "1.0.0"
|
97
97
|
},
|
98
98
|
"type": "module",
|
package/types/index.d.ts
CHANGED
@@ -508,6 +508,7 @@ export interface MathJsInstance extends MathJsFactory {
|
|
508
508
|
RelationalNode: RelationalNodeCtor
|
509
509
|
SymbolNode: SymbolNodeCtor
|
510
510
|
|
511
|
+
Unit: UnitCtor
|
511
512
|
Matrix: MatrixCtor
|
512
513
|
|
513
514
|
/**
|
@@ -3989,15 +3990,17 @@ export interface MathJSON {
|
|
3989
3990
|
fixPrefix?: boolean
|
3990
3991
|
}
|
3991
3992
|
|
3993
|
+
export interface BaseUnit {
|
3994
|
+
dimensions: number[]
|
3995
|
+
key: string
|
3996
|
+
}
|
3997
|
+
|
3992
3998
|
export interface UnitComponent {
|
3993
3999
|
power: number
|
3994
4000
|
prefix: string
|
3995
4001
|
unit: {
|
3996
4002
|
name: string
|
3997
|
-
base:
|
3998
|
-
dimensions: number[]
|
3999
|
-
key: string
|
4000
|
-
}
|
4003
|
+
base: BaseUnit
|
4001
4004
|
prefixes: Record<string, UnitPrefix>
|
4002
4005
|
value: number
|
4003
4006
|
offset: number
|
@@ -4014,8 +4017,7 @@ export interface UnitPrefix {
|
|
4014
4017
|
export interface Unit {
|
4015
4018
|
valueOf(): string
|
4016
4019
|
clone(): Unit
|
4017
|
-
|
4018
|
-
hasBase(base: any): boolean
|
4020
|
+
hasBase(base: BaseUnit | string | undefined): boolean
|
4019
4021
|
equalBase(unit: Unit): boolean
|
4020
4022
|
equals(unit: Unit): boolean
|
4021
4023
|
multiply(unit: Unit): Unit
|
@@ -4040,6 +4042,40 @@ export interface Unit {
|
|
4040
4042
|
skipAutomaticSimplification: true
|
4041
4043
|
}
|
4042
4044
|
|
4045
|
+
export type UnitSystemName = 'si' | 'cgs' | 'us' | 'auto'
|
4046
|
+
|
4047
|
+
export interface UnitStatic {
|
4048
|
+
PREFIXES: Record<string, UnitPrefix>
|
4049
|
+
BASE_DIMENSIONS: string[]
|
4050
|
+
BASE_UNITS: Record<string, BaseUnit>
|
4051
|
+
UNIT_SYSTEMS: Record<
|
4052
|
+
UnitSystemName,
|
4053
|
+
Record<string, { unit: Unit; prefix: UnitPrefix }>
|
4054
|
+
>
|
4055
|
+
UNITS: Record<string, Unit>
|
4056
|
+
parse(str: string): Unit
|
4057
|
+
isValuelessUnit(name: string): boolean
|
4058
|
+
fromJSON(json: MathJSON): Unit
|
4059
|
+
isValidAlpha(c: string): boolean
|
4060
|
+
createUnit(
|
4061
|
+
obj: Record<string, string | Unit | UnitDefinition>,
|
4062
|
+
options?: { override: boolean }
|
4063
|
+
): Unit
|
4064
|
+
createUnitSingle(
|
4065
|
+
name: string,
|
4066
|
+
definition: string | Unit | UnitDefinition
|
4067
|
+
): Unit
|
4068
|
+
getUnitSystem(): UnitSystemName
|
4069
|
+
setUnitSystem(name: UnitSystemName): void
|
4070
|
+
}
|
4071
|
+
|
4072
|
+
export interface UnitCtor extends UnitStatic {
|
4073
|
+
new (
|
4074
|
+
value: number | BigNumber | Fraction | Complex | boolean,
|
4075
|
+
name: string
|
4076
|
+
): Unit
|
4077
|
+
}
|
4078
|
+
|
4043
4079
|
export interface CreateUnitOptions {
|
4044
4080
|
prefixes?: 'none' | 'short' | 'long' | 'binary_short' | 'binary_long'
|
4045
4081
|
aliases?: string[]
|
@@ -4352,7 +4388,14 @@ export interface FormatOptions {
|
|
4352
4388
|
* elsewhere. Lower bound is included, upper bound is excluded. For
|
4353
4389
|
* example '123.4' and '1.4e7'.
|
4354
4390
|
*/
|
4355
|
-
notation?:
|
4391
|
+
notation?:
|
4392
|
+
| 'fixed'
|
4393
|
+
| 'exponential'
|
4394
|
+
| 'engineering'
|
4395
|
+
| 'auto'
|
4396
|
+
| 'hex'
|
4397
|
+
| 'bin'
|
4398
|
+
| 'oct'
|
4356
4399
|
|
4357
4400
|
/**
|
4358
4401
|
* A number between 0 and 16 to round the digits of the number. In case
|
@@ -6846,6 +6889,7 @@ export const {
|
|
6846
6889
|
RelationalNode,
|
6847
6890
|
SymbolNode,
|
6848
6891
|
Matrix,
|
6892
|
+
Unit,
|
6849
6893
|
|
6850
6894
|
uninitialized,
|
6851
6895
|
version,
|