mathjs: update to v4rc

This commit is contained in:
jean-emmanuel 2018-02-13 12:36:31 +01:00
parent b82e70287c
commit 2c7d86f407
2 changed files with 22 additions and 13 deletions

View file

@ -35,7 +35,7 @@
"keyboardjs": "jean-emmanuel/KeyboardJS",
"kiwi.js": "1.0.1",
"licensify": "3.1.3",
"mathjs": "3.20.2",
"mathjs": "^4.0.0-rc.1",
"minimatch": "^3.0.4",
"nanomorph": "^5.1.3",
"node-sass": "4.7.2",

View file

@ -1,14 +1,3 @@
var math = require('mathjs/dist/math.min.js').create({
matrix: 'Array'
})
math.import({
unpack: function(a) { return Array.isArray(a) ? a.toString() : a }
})
// set math's parser array index base to zero
math.expression.mathWithTransform = Object.assign({}, math)
module.exports = {
clip: function(value,range) {
@ -81,5 +70,25 @@ module.exports = {
return hsb
},
math: math
math: (()=>{
var math = require('mathjs/dist/math.min.js').create({
matrix: 'Array'
})
math.import({
unpack: function(a) { return Array.isArray(a) ? a.toString() : a },
// basic relationnal to keep alphabetical string comparison (v4 change)
equal: function (a, b) { return a == b },
unequal: function (a, b) { return a != b },
smaller: function (a, b) { return a < b },
larger: function (a, b) { return a > b },
smallerEq: function (a, b) { return a <= b },
largerEq: function (a, b) { return a >= b }
}, {override:true})
// set math's parser array index base to zero
math.expression.mathWithTransform = Object.assign({}, math)
return math
})()
}