I’m not sure there is right now an exposed utility on this, but open an issue on Catalyst and it’s likely not hard to make.