public static boolean isMinified(@NotNull CharSequence fileContent,@NotNull ParserDefinition parserDefinition,@NotNull TokenSet noWSRequireAfterTokenSet){
  Lexer lexer=parserDefinition.createLexer(null);
  lexer.start(fileContent);
  if (!isMinified(lexer,parserDefinition,noWSRequireAfterTokenSet)) {
    return false;
  }
 else   if (lexer.getTokenType() == null) {
    return true;
  }
  int startOffset=fileContent.length() - COUNT_OF_CONSIDERING_CHARACTERS_FROM_END_OF_FILE;
  if (startOffset <= 0) {
    return true;
  }
  lexer.start(fileContent,startOffset,fileContent.length());
  return isMinified(lexer,parserDefinition,noWSRequireAfterTokenSet);
}

public static boolean isMinified ( @ NotNull CharSequence fileContent , @ NotNull ParserDefinition parserDefinition , @ NotNull TokenSet noWSRequireAfterTokenSet ) { Lexer lexer = parserDefinition . createLexer ( null ) ; lexer . start ( fileContent ) ; if ( ! isMinified ( lexer , parserDefinition , noWSRequireAfterTokenSet ) ) { return false ; } else if ( lexer . getTokenType ( ) == null ) { return true ; } int startOffset = fileContent . length ( ) - COUNT_OF_CONSIDERING_CHARACTERS_FROM_END_OF_FILE ; if ( startOffset <= 0 ) { return true ; } lexer . start ( fileContent , startOffset , fileContent . length ( ) ) ; return isMinified ( lexer , parserDefinition , noWSRequireAfterTokenSet ) ; }
finds out whether the file minified by using common ( not language - specific ) heuristics . can be used for checking of css / less / scss / sass and js files .
