isContentTypeCompressable method Null safety

bool isContentTypeCompressable(
  1. ContentType? contentType
)

Whether or not contentType has been configured to be compressed.

See also setAllowsCompression.

Implementation

bool isContentTypeCompressable(ContentType? contentType) {
  final subtypeCompress =
      _fullySpecifiedCompressionMap[contentType?.primaryType];
  if (subtypeCompress != null) {
    if (subtypeCompress.containsKey(contentType?.subType)) {
      return subtypeCompress[contentType?.subType] ?? false;
    }
  }

  return _primaryTypeCompressionMap[contentType?.primaryType] ?? false;
}