Four years later I’ve found an acceptable solution: you can package a function library in a separate pak chunk and then access a function from it and determine by the outcome if the chunk file is present or not.
If the pak file is missing, such call will just silently fail.