4473 Commits

Author SHA1 Message Date
Jos de Jong
fc5c202e53 Merge branch 'typescript_improvements' of https://github.com/LearnSomethingTeam/mathjs into LearnSomethingTeam-typescript_improvements 2021-10-02 09:41:33 +02:00
Jos de Jong
0afcd44cfd Publish v9.5.0 v9.5.0 2021-09-22 21:16:27 +02:00
Jos de Jong
d8f44ee6ce Update HISTORY.md and AUTHORS 2021-09-22 11:47:29 +02:00
Ramesh Vijayaraghavan
c7f4c53483
Support for Percentage Operation (#2304)
* Support for Percentage Operation

* Fixed Style issue

* Added Test case to check for modulo followed by pi

* Support for % addition and % subtraction

* Fixed Documentation comment

* Support - Should not calculate mod for negative divisor

* Updated Docs

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2021-09-22 11:45:37 +02:00
Jos de Jong
8891d16e92 Add a SECURITY.md file 2021-09-22 09:29:25 +02:00
Jos de Jong
ed0fe9678e Fix #2319: make the API of Parser.evaluate consistent with math.evaluate: support a list with expressions as input 2021-09-20 21:42:36 +02:00
Josh Hansen
8317eb5545 Re-fix the isConditionalNode typo that was corrected in 9.4.5 2021-09-17 01:54:32 -07:00
Josh Hansen
d01d9ea101 Redefine MathNode as a union type of interfaces implementing MathNodeCommon 2021-09-17 01:48:11 -07:00
Josh Hansen
402fa0e362 Array<SimplifyRule> -> SimplifyRule[] 2021-09-17 01:46:33 -07:00
Josh Hansen
8a80ed83a4 Add ConstantNode as an alias for MathNode and return it 2021-09-17 01:46:27 -07:00
Josh Hansen
0a9881e3cf Make AssignmentNode extend MathNode 2021-09-17 01:46:22 -07:00
Josh Hansen
386f21efbd Various improvements to the Typescript typings
Allows instantiation of classes (e.g. new ConstantNode(5))

Corrects the default invocation of `rationalize` (the signatures were in
the wrong order---MathNode is now the default return type)

Makes `create` return a `MathJsStatic` rather than
`Partial<MathJsStatic>` which is painful to use and largely unnecessary
because most fields on MathJsStatic are already optional.

Adds convenient aliases for `subtract`

Adds `implicit?: boolean` to MathNode

Make the unit on Unit.toNumber and Unit.toNumeric optional like it is in practice

Represent math.simplify.rules and math.simplify.simplifyCore
2021-09-17 01:46:16 -07:00
Jos de Jong
a0e6e34b3f Update history.md 2021-09-15 22:10:29 +02:00
Wim Devos
d3c63677d0
Update SetCartesian documentation (#2310)
* Update SetCartesian documentation

* Remove trailing spaces

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2021-09-15 22:08:43 +02:00
Jos de Jong
895a7a6461 Publish v9.4.5 v9.4.5 2021-09-15 12:27:50 +02:00
Jos de Jong
5601552c08 Revert mocha to v8 again (with v9, 5 unit tests fail on IE11 with unclear reason) 2021-09-15 12:25:11 +02:00
Jos de Jong
db39237c0f Update browser versions in browserstack tests 2021-09-15 12:24:40 +02:00
Jos de Jong
f54a91e898 Update devDependencies 2021-09-15 11:36:10 +02:00
Jos de Jong
14390dc0b9 Update history and authors list 2021-09-15 11:15:45 +02:00
Tom Larkworthy
efe367cad5
Fix performance problem with deepStrictEqual (#2301)
Issue #2300

deepStrictEqual was called twice for each property

Co-authored-by: Tom Larkworthy <tomlarkworthy@Toms-MacBook-Air.local>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2021-09-15 10:25:18 +02:00
Michal Grňo
37cc651df2
Fix typo in isConditionalNode in types/index.d.ts (#2307)
`isConditionalnode` → `isConditionalNode`

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2021-09-15 09:52:38 +02:00
Michal Grňo
64909e7fc2
add isRelationalNode to MathNode in types/index.d.ts (#2308)
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2021-09-15 09:42:29 +02:00
Kiran Chand
34e461aec4
Adding type definition for hasNumericValue (#2281)
* adding hasNumericValue to types

* adding hasNumericValue to types

Co-authored-by: write2kcl <write2kcltech@alamy.com>
2021-09-15 09:29:05 +02:00
Jos de Jong
f048e2c8d7 Upgrade package-lock.json to "lockfileVersion": 2 (using Node.js v16, npm v7). See #2266 2021-07-07 15:48:02 +02:00
Jos de Jong
2f8f088ab1 Publish v9.4.4 v9.4.4 2021-07-07 10:35:58 +02:00
Jos de Jong
e8a4123fc2 Fix #2258: drop official support for nodejs 10 2021-07-07 10:29:09 +02:00
Jos de Jong
6560f65740 Update dependencies, history, and authors 2021-07-07 10:26:42 +02:00
Michal Grňo
c7b09fea36
Add core-js polyfill for lib/browser (#2266)
* added core-js polyfills for lib/browser/math.js

* exclude defaultInstanceCorejs from lib/esm and lib/cjs

* removed a semicolon

* changed useBuiltIns to usage

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2021-07-07 09:48:42 +02:00
Michal Grňo
4dbf40460b
Fix intersect not returning null for matrix input (#2270)
* refactored intersect, fixed it not returning null for matrix input

* intersect: improved flattening algorithm, added tests

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2021-07-07 09:16:22 +02:00
CRIMX
fe7d8a7100
docs(expressions): fix incorrect example link (#2273) 2021-07-07 08:28:01 +02:00
Jos de Jong
eb6c0ec458 Update history and authors 2021-07-03 12:11:31 +02:00
davidtranhq
f79fec6db5
Fix ArrayNode.toTex(): Remove the row delimiter on the last row (#2267)
* fix toTex(): remove row delimiter on the last row

* remove row delimiter on the last row (use map and join instead of forEach)

* fix ArrayNode.toTex() unit tests incorrectly expecting a row delimiter on the last row

* added toTex() tests for nested cases

* fixed ArrayNode.toTex() for nested cases

* removed redunant variable
2021-07-03 12:10:22 +02:00
Jos de Jong
fcaa242fb1 Publish v9.4.3 v9.4.3 2021-06-23 15:34:36 +02:00
Jos de Jong
7732f07519 Update history 2021-06-23 15:25:30 +02:00
Jos de Jong
9ba193ce8a Update history, remove a redundant config setting 2021-06-23 15:24:05 +02:00
Michal Grňo
b4eed8ee92
Fix Decimal prototype pollution (#2244)
* changed BigNumber to a class that extends Decimal.clone(...)

* it works... if you patch decimal.js

* added a test that checks if sum of Decimals works

* minor improvement of code quality

* updated Decimal.js to 10.3

* removed the optional chaining operator to keep compat w/ Node 12

* removed try/catch from isBigNumber

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2021-06-23 15:23:08 +02:00
Jos de Jong
6f804cb882 Revert to mocha@8.4.0, mocha@9.0.1 causes some of the unit tests to fail on IE 11 2021-06-23 15:01:08 +02:00
Jos de Jong
645c80e9bb Use configured mocha timeout in karma tests 2021-06-23 13:07:03 +02:00
Jos de Jong
b71a4e01e9 Update devDependencies 2021-06-23 11:15:08 +02:00
Jos de Jong
8d6aaf3957 Oops, set forbid-only true again 2021-06-23 11:05:10 +02:00
Jos de Jong
4d841e4572 Create a mocha config file, define global timeout of 10 seconds 2021-06-23 11:03:08 +02:00
Jos de Jong
ebb5fce7c2 Run unit tests on Node 16 2021-06-23 10:51:57 +02:00
Jos de Jong
1469ddf381 Fix linting issue, update history and authors 2021-06-23 10:51:14 +02:00
Kiran Chand
0850ac2ca6
Fixing incorrect typing error for floor function. (#2246)
* fixing incorrect typing error for floor function

* removing prettier auto format

Co-authored-by: write2kcl <write2kcltech@alamy.com>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2021-06-23 10:45:16 +02:00
Manuel Serra
6e2abc90ec
Fix outdated types (#2252)
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2021-06-23 10:43:50 +02:00
Jos de Jong
c8742d18cf Fix #2253: expression parser throwing an error when accessing nested object properties named e 2021-06-23 10:35:17 +02:00
Jos de Jong
8b3e0e1067 Fix #2255: document the implicit property of OperatorNode 2021-06-23 10:02:33 +02:00
Jos de Jong
780bde7ed5 Extend example custom_datatype.js demoing it a bit more 2021-06-23 09:15:31 +02:00
Jos de Jong
69e395cd2f Extend example custom_datatype.js demoing it a bit more 2021-06-23 09:14:49 +02:00
Jos de Jong
251b16713a Update AUTHORS 2021-06-20 10:47:44 +02:00