function computeOffsetPixels(offset, contextHeight) {
  const pixelOffset = parseOffsetAsPixels(offset);

  if (typeof pixelOffset === 'number') {
    return pixelOffset;
  }

  const percentOffset = parseOffsetAsPercentage(offset);
  if (typeof percentOffset === 'number') {
    return percentOffset * contextHeight;
  }

  return undefined;
}
@param {string|number} offset
@param {number} contextHeight
@return {number} A number representing `offset` converted into pixels.