function pointsAligned(a, b) {
  var points = Array.from(arguments).flat();

  const axisMap = {
    'x': 'v',
    'y': 'h'
  };

  for (const [ axis, orientation ] of Object.entries(axisMap)) {
    if (pointsAlignedOnAxis(axis, points)) {
      return orientation;
    }
  }

  return false;
}
Check whether two points are horizontally or vertically aligned.

@param {Point[]|Point} a
@param {Point} [b]

@return {string|boolean} If and how the two points are aligned ('h', 'v' or `false`).