Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mathjs): updates mathjs to v7 from v3 #595

Merged
merged 2 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/application/worker/store/modules/expressions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import math from "mathjs";
import uuidv4 from "uuid/v4";
const math = require("mathjs");

const state = {
assignments: {}
Expand All @@ -17,12 +17,14 @@ const getters = {
function compileExpression(expression) {
const scope = { value: 0, time: 0 };

console.log(math);
TimPietrusky marked this conversation as resolved.
Show resolved Hide resolved

let newFunction;
try {
const node = math.parse(expression, scope);

newFunction = node.compile();
newFunction.eval(scope);
newFunction.evaluate(scope);
} catch (e) {
throw e;
}
Expand Down
2 changes: 1 addition & 1 deletion src/application/worker/store/modules/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ const actions = {
time: Date.now()
};

dataOut = expressionAssignment.func.eval(scope);
dataOut = expressionAssignment.func.evaluate(scope);
}

if (store.state.dataTypes[type] && store.state.dataTypes[type].create) {
Expand Down