Applies fn on x,y & z (if present) fields, returning all other fields as well

const p = {x:1.234, y:4.9};
const p2 = Points.apply(p, Math.round);
// Yields: {x:1, y:5}

The name of the field is provided as well. Here we only round the x field:

const p = {x:1.234, y:4.9};
const p2 = Points.apply(p, (v, field) => {
if (field === `x`) return Math.round(v);
return v;
});