Skip to content

Commit a4cc40a

Browse files
authored
chore(packages): set bodyLengthChecker type to BodyLengthCalculator (#3407)
1 parent e5d2e1c commit a4cc40a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

packages/middleware-flexible-checksums/src/configuration.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import { Encoder, GetAwsChunkedEncodingStream, HashConstructor, StreamHasher } from "@aws-sdk/types";
1+
import {
2+
BodyLengthCalculator,
3+
Encoder,
4+
GetAwsChunkedEncodingStream,
5+
HashConstructor,
6+
StreamHasher,
7+
} from "@aws-sdk/types";
28

39
export interface PreviouslyResolved {
410
/**
@@ -10,7 +16,7 @@ export interface PreviouslyResolved {
1016
/**
1117
* A function that can calculate the length of a body.
1218
*/
13-
bodyLengthChecker: (body: any) => number | undefined;
19+
bodyLengthChecker: BodyLengthCalculator;
1420

1521
/**
1622
* A function that returns Readable Stream which follows aws-chunked encoding stream.

packages/types/src/stream.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { HashConstructor, StreamHasher } from "./crypto";
2-
import { Encoder } from "./util";
2+
import { BodyLengthCalculator, Encoder } from "./util";
33

44
export interface GetAwsChunkedEncodingStreamOptions {
55
base64Encoder?: Encoder;
6-
bodyLengthChecker: (body: any) => number | undefined;
6+
bodyLengthChecker: BodyLengthCalculator;
77
checksumAlgorithmFn?: HashConstructor;
88
checksumLocationName?: string;
99
streamHasher?: StreamHasher;

0 commit comments

Comments
 (0)