function getStylesheetObjects(file, options) {
  const {ignoreInlinedStyles} = options || {};
  if (!isVinyl(file)) {
    throw new Error('Parameter file needs to be a vinyl object');
  }

  // Already computed stylesheetObjects
  if (file.stylesheetObjects) {
    return file.stylesheetObjects;
  }

  const stylesheets = oust.raw(file.contents.toString(), ['stylesheets', 'preload', 'styles']);

  const isNotPrint = (el) =>
    el.attr('media') !== 'print' || (Boolean(el.attr('onload')) && el.attr('onload').includes('media'));

  const isMediaQuery = (media) => typeof media === 'string' && !['all', 'print', 'screen'].includes(media);

  const allowedInlinedStylesheet = (type) => type !== 'styles' || !ignoreInlinedStyles;

  const objects = stylesheets
    .filter((link) => isNotPrint(link.$el) && Boolean(link.value) && allowedInlinedStylesheet(link.type))
    .map((link) => {
      const media = isMediaQuery(link.$el.attr('media')) ? link.$el.attr('media') : '';

      // support base64 encoded styles
      if (link.value.startsWith('data:')) {
        const parsed = dataUriToBuffer(link.value);
        return {
          media,
          value: Buffer.from(parsed.buffer),
        };
      }

      if (link.type === 'styles') {
        return {
          media,
          value: Buffer.from(link.value),
        };
      }

      return {
        media,
        value: link.value,
      };
    });

  const isEqual = (a, b) => Buffer.from(a).compare(Buffer.from(b)) === 0;
  const compare = (a, b) => isEqual(a.media, b.media) && isEqual(a.value, b.value);
  // Make objects unique
  const stylesheetObjects = objects.filter((a, index, array) => {
    return array.findIndex((b) => compare(a, b)) === index;
  });

  // cache them for later use
  file.stylesheetObjects = stylesheetObjects;

  return stylesheetObjects;
}
Extract stylesheet urls from html document
@param {Vinyl} file Vinyl file object (document)
@param {object} options Options passed to critical
@returns {[string]} Stylesheet urls from document source