Add return types and switch to function for Maths. https://code.usgs.gov/ghsc/nshmp/nshmp-utils-ts/-/merge_requests/295