function objectPick(obj, keys, transform) {
  const res = {};
  for (const key of keys) {
    let value = obj?.[key];
    if (transform) value = transform(value, key);
    if (value !== undefined) res[key] = value;
  }
  return res;
}
@param {{}} obj
@param {string[]} keys
@param {function(value,key):?} [transform]
@returns {{}}