Skip to content

Commit 40839fa

Browse files
AllanZhengYPsrchase
authored andcommitted
feat(util-create-request): create request package (#257)
1 parent c47cece commit 40839fa

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

packages/types/src/command.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export interface Command<
3737
> {
3838
readonly input: InputType;
3939
readonly model: OperationModel;
40+
readonly middlewareStack: MiddlewareStack<InputType, OutputType, StreamType>;
4041
resolveMiddleware(
4142
stack: MiddlewareStack<ClientInput, ClientOutput, StreamType>,
4243
configuration: ResolvedConfiguration

packages/types/src/middleware.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,14 @@ export interface MiddlewareStack<
269269
*/
270270
clone(): MiddlewareStack<Input, Output, Stream>;
271271

272+
/**
273+
* same to clone, but only filter in middlewares when evaluation callback
274+
* function returns true.
275+
*/
276+
filter(
277+
callbackfn: (middlewareStats: HandlerOptions) => boolean
278+
): MiddlewareStack<Input, Output, Stream>;
279+
272280
/**
273281
* Create a list containing the middlewares in this list as well as the
274282
* middlewares in the `from` list. Neither source is modified, and step

0 commit comments

Comments
 (0)