isStandardSyntaxComment.js 392 B

123456789101112131415
  1. 'use strict';
  2. /**
  3. * @param {import('postcss').Comment} comment
  4. * @returns {boolean}
  5. */
  6. module.exports = function isStandardSyntaxComment(comment) {
  7. // We check both here because the Sass parser uses `raws.inline` to indicate
  8. // inline comments, while the Less parser uses `inline`.
  9. if ('inline' in comment) return false;
  10. if ('inline' in comment.raws) return false;
  11. return true;
  12. };