This is a duplicated question of the one asked on StackOverflow. I answered it there.
https://stackoverflow.com/questions/58851407/how-to-include-helpers-in-jsreport/58883252#58883252
Please don't post questions duplicates. Choose forum or so, what you prefer, and ask just once.