function callPenthouse(document, options) {
  const {dimensions, width, height, userAgent, user, pass, penthouse: params = {}} = options;
  const {customPageHeaders = {}} = params;
  const {css: cssString, url} = document;
  const config = {...params, cssString, url};
  // Dimensions need to be sorted from small to wide. Otherwise the order gets corrupted
  const sizes = Array.isArray(dimensions)
    ? [...dimensions].sort((a, b) => (a.width || 0) - (b.width || 0))
    : [{width, height}];

  if (userAgent) {
    config.userAgent = userAgent;
  }

  if (user && pass) {
    config.customPageHeaders = {...customPageHeaders, Authorization: `Basic ${token(user, pass)}`};
  }

  return sizes.map(({width, height}) => () => {
    const result = penthouse({...config, width, height});
    debug('Call penthouse with:', {
      ...config,
      width,
      height,
      cssString: `${(cssString || '').slice(0, 10)} ... ${(cssString || '').slice(-10)}`,
    });

    return result;
  });
}
Let penthouse compute the critical css
@param {vinyl} document Vinyl representation of the HTML document
@param {object} options Options passed to critical
@returns {string} Critical css for various dimensions combined and deduped