#231 map return types for JavaScript