tsoding / emoteJAM

Simple website that generates animated BTTV emotes from static images.
https://tsoding.github.io/emoteJAM/
MIT License
158 stars 21 forks source link

Fix storing context `vars` value as string #70

Closed kolumb closed 3 years ago

kolumb commented 3 years ago

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 commented 3 years ago

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