[lib] Introduce invertObjectToMap
Summary:
Context: https://linear.app/comm/issue/ENG-5640/consider-introducing-invertobjecttomap-utility-fn
Thanks @tomek for investigating + resolving the flow issues with this utility!
Test Plan: Consumed in minimally-encoded-thread-permissions, where the unit tests continue to succeed.
Reviewers: ashoat, tomek, ginsu, rohan
Reviewed By: ashoat
Subscribers: wyilio, tomek
Differential Revision: https://phab.comm.dev/D9676