Skip to content

Commit

Permalink
Make CompressionInputConfig properties optional (smithy-lang#1133)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Jan 4, 2024
1 parent cacd9cf commit f48de63
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/nice-pumas-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@smithy/middleware-compression": patch
---

Make CompressionInputConfig properties optional
4 changes: 2 additions & 2 deletions packages/middleware-compression/src/configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export interface CompressionInputConfig {
/**
* Whether to disable request compression.
*/
disableRequestCompression: boolean | Provider<boolean>;
disableRequestCompression?: boolean | Provider<boolean>;

/**
* The minimum size in bytes that a request body should be to trigger compression.
* The value must be a non-negative integer value between 0 and 10485760 bytes inclusive.
*/
requestMinCompressionSizeBytes: number | Provider<number>;
requestMinCompressionSizeBytes?: number | Provider<number>;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { CompressionInputConfig, CompressionResolvedConfig } from "./configurati
/**
* @internal
*/
export const resolveCompressionConfig = <T>(input: T & CompressionInputConfig): T & CompressionResolvedConfig => ({
export const resolveCompressionConfig = <T>(
input: T & Required<CompressionInputConfig>
): T & CompressionResolvedConfig => ({
...input,
disableRequestCompression: normalizeProvider(input.disableRequestCompression),
requestMinCompressionSizeBytes: async () => {
Expand Down

0 comments on commit f48de63

Please sign in to comment.