18 Commits

Author SHA1 Message Date
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
e051cae156 Do not use Object.entries for now (gives IE11 error, babel transpilation missing I suppose) 2021-05-19 16:34:19 +02:00
jhugman
e80995d52d
Add support for scopes with get and set methods (#2166)
* Add support for scopes with get and set methods

* Fix build for node v12

* Fixup cli and parser tests

* Add tests for simplify and evaluate

* Add example for a custom scope object

* Function calls need child scopes

* Transitionary step: Separate Safe and Scope Property calls

* Renamed identifiers in FunctionNode

* Evaluate with ObjectScopeWrapper

* Simplify tests passing

* Assume all scopes are map-like. Except parser

* Remove isMapLike check in customs.*SafeProperty() methods

* Change MapLike to Map

* Move keywords from an Object to a Set

* Move ScopeProperty functions in to scope.js

* Removed deprecation warning

* Rename scope.js to map.js

* Rename ScopeProperty to MapProperty

* Add tests and docs for map.js

* Put back the micro-optimization of function calls

* Use Map in the parser

* Called scope methods directly in cli.js

* Coercing of scope into a Map is done in Node, not evaluate

* Move createSubScope to its own file

* Fixup following self-review

* Add scope docs

* Final self-review changes

* Address reviewer comments

* Remove MapProperty witness marks

* Converted broken benchmark possibly lost in a rebase

* Use bare map as scope in benchmark

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2021-05-16 13:33:01 +02:00
Jos de Jong
67a9878073 Revert "Configure default timeout for mocha tests as 10 seconds"
This reverts commit f812e662
2021-02-03 19:01:15 +01:00
Jos de Jong
f812e66252 Configure default timeout for mocha tests as 10 seconds 2021-02-03 17:58:37 +01:00
Quentin Truong
02d36c1177
Check for equal number of arguments in simplify (#2090)
* Check for equal number of arguments when simplifying non-associative nodes

* Use === instead of ==

* Run linter and remove trailing space
2021-01-27 11:10:14 +01:00
Jos de Jong
9250f44e88 Fix #2026: introduce new option fractionsLimit in function simplify 2020-11-13 15:14:04 +01:00
Jos de Jong
488943d299 Fix #2026: have function simplify not output decimal values into fractions with very large numerator/denominator 2020-11-13 14:47:30 +01:00
Jos de Jong
41c5e2fabe Merge branch 'develop' into v8
# Conflicts:
#	HISTORY.md
#	package-lock.json
#	package.json
#	src/expression/embeddedDocs/embeddedDocs.js
#	src/factoriesAny.js
#	src/function/special/erf.js
#	src/plain/number/probability.js
#	src/version.js
2020-11-02 11:59:12 +01:00
Jos de Jong
3c9d9a9fc5 Increase timeouts for IE 2020-11-02 09:46:49 +01:00
Jos de Jong
eb9fcb3c41 Fix timeout on IE10 2020-10-18 13:05:11 +02:00
Jos de Jong
6f00715754
Specify import require paths (continuation of #1941) (#1962)
* Add `.js` extension to source file imports

* Specify package `exports` in `package.json`

Specify package type as `commonjs` (It's good to be specific)

* Move all compiled scripts into `lib` directory

Remove ./number.js (You can use the compiled ones in `./lib/*`)

Tell node that the `esm` directory is type `module` and enable tree shaking.

Remove unused files from packages `files` property

* Allow importing of package.json

* Make library ESM first

* - Fix merge conflicts
- Refactor `bundleAny` into `defaultInstance.js` and `browserBundle.cjs`
- Refactor unit tests to be able to run with plain nodejs (no transpiling)
- Fix browser examples

* Fix browser and browserstack tests

* Fix running unit tests on Node 10 (which has no support for modules)

* Fix node.js examples (those are still commonjs)

* Remove the need for `browserBundle.cjs`

* Generate minified bundle only

* [Security] Bump node-fetch from 2.6.0 to 2.6.1 (#1963)

Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. **This update includes a security fix.**
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Cleanup console.log

* Add integration tests to test the entry points (commonjs/esm, full/number only)

* Create backward compatibility error messages in the files moved/removed since v8

* Describe breaking changes in HISTORY.md

* Bump karma from 5.2.1 to 5.2.2 (#1965)

Bumps [karma](https://github.com/karma-runner/karma) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v5.2.1...v5.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

Co-authored-by: Lee Langley-Rees <lee@greenimp.co.uk>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-20 18:01:29 +02:00
Michal Grňo
ba4ff2f9c9
Add usolveAll and lsolveAll methods (#1916)
* refactor solveValidation

* refactor usolve

* usolve algorithm implemented (for square mat.)

* added lsolve, consistent return type, fixed tests

* fixed lusolve and its tests, fixed linting issues

* added tests for usolve&lsolve, try-catch in lusolve

* put changes into separate files (u-/lsolveAll), revert changes to u-, l- and lusolve

* made *solveAll return [] for non-solvable, implemented sparse algorithms

* improved documentation for *solve(All)

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2020-08-29 13:11:16 +02:00
David Bramwell
88733f70af
Let simplify handle a/(b/c) (#1734)
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2020-02-04 20:34:37 +01:00
jos
1d5ad22296 Remove redundant code causing a vague error, see #1724 2020-02-04 20:30:35 +01:00
Harry Sarson
462f46947f fix qr and sign edge cases (#1670)
* fix qr and sign edge cases

qr() was throwing an error if the pivots of a matrix were zero.
This commit fixes that and ensures that the results are consistant
with wolfram alpha.

Whilst doing this I found a bug in complex.js, I have added a work
around but we should flag this upstream.

I also addressed the long standing concerns about assert statements
within the body of the qr function.

Fixes #1669
Fixes #942

* further improvements to qr and sign

mainly fixing things I got wrong in previous commit

* add array test

* fix: remove only from tests and disallow

Uses mochas `--forbid-only` flag as advised by
https://github.com/standard/standard/issues/988
2019-11-18 20:03:09 +01:00
jos
d8a4f3a00a Update to standard@13.0.2 2019-07-20 13:46:31 +02:00
jos
db4910bed4 Move all test related stuff in folder test 2019-06-05 11:45:02 +02:00