#include "third_party/blink/renderer/modules/compression/compression_format.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
#include "third_party/blink/renderer/platform/wtf/text/strcat.h"
namespace blink {
CompressionFormat LookupCompressionFormat(const AtomicString& format,
ExceptionState& exception_state) {
if (format == "gzip") {
return CompressionFormat::kGzip;
} else if (format == "deflate") {
return CompressionFormat::kDeflate;
} else if (format == "deflate-raw") {
return CompressionFormat::kDeflateRaw;
}
exception_state.ThrowTypeError(
StrCat({"Unsupported compression format: '", format, "'"}));
return CompressionFormat::kGzip;
}
}