Add functions to utils as utils.unstable
Right now I'm using many of these functions throughout apicompose, scripts, relevance statements etc in SurveyStack - often 5 or 6 of them in one script. They have been pretty thoroughly used and tested (all of them) in a range of real world applications, so they aren't experimental - however, they certainly could use review.
That said - the practical need is to reduce my chances of mistakes because they are being copy-pasted in throughout surveys I use all the time, which creates errors and wastes time, especially when I need to update them.
We have a location today for functions which are always available in all coding environments in the app - utils
. There is a long-term need to re-consider how we manage functions in the survey development environment, but in the short term I'd like to include these in utils.unstable
which should be available anywhere in the current coding environment (relevance, apicompose, scripts, etc.). This solves my problem, without opening up their use to everyone.
These are the functions to include. All of them are self-contained (ie they don't require external libraries, and only impact passed items and don't assume the presence of other variables like submission
or parent
, etc.).
- https://gitlab.com/-/snippets/2176155
- https://gitlab.com/-/snippets/2550834
- https://gitlab.com/-/snippets/2393020
Finally - by adding them to unstable
, it gives us space to test and move to more permanent solutions with limited impact.