Transforms own properties of an object using a mapping function.
(Object 'a, ((String, 'a)) => (String, 'b)) => Object 'b :: throws Error
Transforms own properties of an object using a mapping function.
This function is a specialised form of mapEntries
that throws
when a key collision happens. Throwing makes this function potentially
unsafe to use, however it guarantees a consistent behaviour across
different ECMAScript versions and VMs.
(object, transform) =>
mapEntries(object, transform, (result, key, value) => {
if (result::hasOwnProperty(key)) {
throw new Error(`The property ${key} already exists in the resulting object.`);
}
result[key] = value;
return result;
})