* chore(package): update standard to version 12.0.0
* update to new lint version with --fix
I believe this mainly adds whitespace to `{}`'s.
* Replace assert.equal with assert.strictEqual
This breaks a lot of tests which I will endevour to fix in the next
commits.
* Fix most errors due to assert.strictEquals
Some instances of `strictEquals` are replaced by `deepEquals`.
`toString` has been used to make some string comparisions explicit.
Tests will still fail untill #1236 and #1237 are fixed.
* Fix assertion erros due to -0
With node 10, assert.strictEqual no longer considers `0 === -0`.
I missed these first time round as I was using node 8.
* Put toString correct side of bracket
I was converting the constructor to a string rather
than the result of the computation. Oops.
* Fixed#1236: quantileSeq has inconsistant return
* Update package-lock
* Fixed#1237: norm sometimes returning a complex number instead of number
* Fix cli tests
* More changes for standardjs, and fixes in unit tests
Fix of bug fixes in `rationalize.js`, also changing `simplify.js` and `simplifyConstant.js` and more 2 bugs in `simplify.js` and `simplifyconstant.js` in order to be possible passing in `Travis` test.
**Bugs in `simplifyConstant.js` and `simplify.js`**
1. `simplifyConstant.js` - I've changed `new ConstantNode(stringNumber, 'number')` to `new ConstantNode(number)`
1. `simplify.js` - Due to problems with a number node with string type, I've added `!isNaN(node.value)))` in number type test condition
**Bugs in `rationalize.js`**
3. I've fixed negative power exponents and decimals coefficients troubles. The decimals coefficients problem has led to the need to add a new feature in `simplify.js ` and `simplifyConstant.js` (next topic)
**New feature in `simplify.js` and `simplifyConstant.js`**
4. New rule type (string), whose valid values are in `listCommStrings` new variable. The only string rule accepted so far is to turn off exact fraction conversion in `simplifyConstant.js`
`state.c` is always equal to `state.expression.charAt(state.index)`.
Therefore, the property `c` does not need to be included in the state.
This commit replaces all occurances of `state.c` with `currentCharacter(state)`.
This commit adds two functions:
- `currentCharacter` replaces `state.c`
- `currentString` which returns a substring starting at the current character.
Rename `nextPreview` and `prevPreview` to `nextCharacter` and `prevCharacter`
respectively so that these function names reflect the purpose of these functions.
This commit entirely removes the global state from `parse`.
The state is passed as an object to each function, functions modify the state passed to them.
Combines most of the global state used when passing expressions into an object called `state`.
This makes it easier to refactor this code going forward and clarifies which functions touch the global state.
`tokenStates` is still a seperate global variable which now contains copies of the state.