99 Commits

Author SHA1 Message Date
redbar0n
10decb0fed
Update clone.js with doc about deep copying arrays (#2040)
* Update clone.js with doc about deep copying arrays

Since it was missing, and it is important documentation for anyone using math.clone for arrays of arrays (matrices). The deep copying was inferred from the test case, but it shouldn't have been necessary. Now it will hopefully be shown in the doc on the webpage, too.

* Update description to be more general.

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2020-12-03 17:45:20 +01: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
Nick Ewing
859cfa208a
Replace recursive calls in typed-functions with this-style calls (#1903)
* Fix #1902: typo in an example in the documentation

* Replace recursive calls in typed-functions with `this`-style calls

* Replace more recursive calls in typed-functions with `this`-style calls

* Refactor compareNatural to use this-style recursion

Co-authored-by: josdejong <wjosdejong@gmail.com>
2020-07-13 17:37:30 +02:00
josdejong
23e38bea60 Remove all deprecated code and warnings 2020-05-06 21:57:33 +02:00
Arthur Guiot
34b676a1cc Improved performances for isPrime (#1641)
* Improved performances for isPrime

The prime test performance have been improved compared to previous version.

* Fixed build

* Fixed build for isPrime

* Removed extra semicolons to fix lint
2019-10-06 10:40:48 +02:00
jos
a4f84512cd Fixed #1615: error in the docs of isNumeric 2019-09-11 10:10:46 +02:00
jos
d8a4f3a00a Update to standard@13.0.2 2019-07-20 13:46:31 +02:00
jos
41efed79d3 Fix #1473: remove 'use strict' in every file 2019-05-26 20:21:18 +02:00
jos
33cead1327 Improved deprecation errors and warnings. Introduce lazy again for factories. 2019-04-22 09:45:57 +02:00
jos
22bec13d10 Implement number factories, dependencies. Make matrix and bignumber optional where possible 2019-04-03 09:46:44 +02:00
jos
6acadd71a0 Create number implementations of all functions in mainNumber.js 2019-03-06 21:49:30 +01:00
jos
892f8670ef Merge branch 'develop' into modular_architecture_merge
# Conflicts:
#	src/expression/embeddedDocs/index.js
2019-02-09 21:59:32 +01:00
jos
554d2243de Refactor hasNumericValue and sum.transform 2019-02-09 21:56:22 +01:00
jos
ec848b7624 Improve docs of hasNumericValue 2019-02-09 21:55:28 +01:00
jos
049f80248d Add embedded docs for hasNumericValue 2019-02-09 21:55:04 +01:00
jos
83df09800b Merge branch 'develop' into modular_architecture_merge
# Conflicts:
#	HISTORY.md
#	gulpfile.js
#	package-lock.json
#	package.json
#	src/core/function/typed.js
#	src/expression/transform/index.js
#	src/function/statistics/sum.js
#	src/function/utils/index.js
#	src/type/unit/Unit.js
#	src/version.js
#	test/expression/node/FunctionNode.test.js
#	test/type/unit/function/createUnit.test.js
#	test/utils/bignumber/formatter.test.js
#	test/utils/number.test.js
2019-02-09 21:26:25 +01:00
jos
99da53da0e Flatten everything in a mathjs instance to make it consistent with the ES6 exports. Create deprecation warnings for the old classes and functions 2019-02-07 21:24:51 +01:00
jos
869d4960f9 Create and use factory.js to import all dependencies in main instance. Deprecate all old nested index.js files. 2019-01-30 14:38:47 +01:00
jos
c42844a5d8 Flatten all type.* dependencies 2019-01-30 13:47:45 +01:00
jos
e36cb13c25 Implement util function warnOnce which is used for deprecated functionality 2019-01-14 21:16:44 +01:00
jos
05e6cfec7f Doc generation working again. Renamed variance and evaluate occurrences in the docs. 2019-01-09 11:21:43 +01:00
jos
01a230a996 Add /* #__PURE__ */ everywhere to enable tree-shaking in webpack 2018-12-01 11:21:36 +01:00
jos
9750beb841 Cleanup redundant local variables 2018-11-21 18:18:10 +01:00
jos
19275e5eaa Moved all toTex properties to latex util file 2018-11-21 18:08:21 +01:00
jos
7a48d972ce Refactored all statistics functions. Renamed var to variance 2018-11-09 12:33:13 +01:00
jos
2d7a407ee2 Create mainAll.js. Change algorithm functions to be internal factory functions (not injected). Convert more functions and data types. 2018-11-07 16:43:06 +01:00
jos
2fd6cbd568 Converted matrix classes. Fixes in dependency resolving/ordering. 2018-11-07 12:38:00 +01:00
jos
f6b524a966 Use object destructuring in factory function callback. Rename typeof to typeOf. Only pass dependencies in scope to factory function. 2018-11-06 09:17:21 +01:00
jos
c1a8004a12 - Created a util function factory
- Implemented resolving dependencies
- Converted the first few factory functions
2018-11-05 17:27:42 +01:00
Sathish-kumar-Subramani
3cbe1e05ef add util function hasNumericValue (#1303)
* add util function hasNumericValue

* hasNumericValue - add Number wrapper object. add more test cases.

* hasNumericValue - add test case to check if string with number, surrounded by whitespace is valid.
2018-11-03 10:08:45 +01:00
jos
94e9668b4a Refactor functions into ES6 import/export 2018-10-31 20:53:01 +01:00
jos
9800f25b35 Reorganized utils functions and refactored to ES6 import/export 2018-10-31 19:58:33 +01:00
jos
e3211a7efc Move all is* functions like isComplex into is.js 2018-10-31 15:28:51 +01:00
jos
b6ab40cf88 Fixed #1214: median and other functions not neatly handling NaN 2018-08-21 21:16:15 +02:00
jos
9b2d2d4611 Release v5.1.0 2018-08-12 21:35:20 +02:00
Jos de Jong
d711cb1132
Fixed a typo in an example 2018-07-28 16:57:05 +02:00
Jos de Jong
6abe31803e
Insert zero width white spaces to prevent the table from getting too wide (see #1176) 2018-07-19 21:11:45 +02:00
jos
4254b7413f Dropped support for (non-primitive) instances of Number, Boolean, and String from functions clone and typeof 2018-06-13 17:56:18 +02:00
jos
600cfb403a Fix return statement should not contain assignment 2018-06-13 17:37:27 +02:00
jos
0583771e4e Cleanup unused variables and imports 2018-06-13 17:25:51 +02:00
jos
b6b36bfd9b Use strict equality checks everywhere (=== and !==) 2018-06-13 15:02:21 +02:00
jos
b3b96749bf Refactored var into const/let, and removed a lot of semicolons 2018-06-13 12:21:14 +02:00
jos
024b2a9e26 Fix most lint errors using npx standard --fix 2018-06-10 20:28:27 +02:00
jos
35329d7db4 Move lib to src 2018-06-06 14:37:39 +02:00
Sebastien Piquemal
aa0249d458 fixed npm install, changed src to lib 2013-08-14 15:00:12 +04:00
josdejong
3f79c70473 Improved module structure, removed references to a global namespace 2013-08-11 20:42:32 +02:00
josdejong
fee1c51272 Fixed getting/setting subset of an Array via the parser 2013-08-11 14:47:33 +02:00
josdejong
d76602a2ee Changed syntax of range to range(start, end [, step]) 2013-08-09 22:33:58 +02:00
josdejong
aa471db411 Upperbound of range is now excluded 2013-08-09 22:09:46 +02:00
josdejong
10633d7237 Minor improvements in the static functions of prototypes 2013-08-07 14:42:02 +02:00