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 storing context vars value as string #70

Merged
merged 3 commits into from
Jun 16, 2021

Conversation

kolumb
Copy link
Contributor

@kolumb kolumb commented Jun 9, 2021

I was using variables in duration expression and noticed that it's concatenating value as strings.
For example if you change duration of Hop filter to "duration": "interval + 2" it calculates it as 0.852 instead of 2.85 here:

const duration = Math.min(run_expr(program.duration, context), 60);
console.log({duration})

@rexim
Copy link
Member

rexim commented Jun 16, 2021

@kolumb good catch! Thank you very much! 👍 The reason why TypeScript didn't help in here is because of Tag being any which we gonna fix in #73

@rexim rexim merged commit 8c396e2 into tsoding:master Jun 16, 2021
@kolumb kolumb deleted the fix-input-value branch June 16, 2021 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants