Skip to content

Commit

Permalink
Add getSmithyContext() helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Yuan committed Sep 13, 2023
1 parent c0c11b4 commit c47b765
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-vans-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@smithy/util-middleware": patch
---

Add `getSmithyContext()` helper function
7 changes: 7 additions & 0 deletions packages/util-middleware/src/getSmithyContext.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { HandlerExecutionContext, SMITHY } from "@smithy/types";

/**
* @internal
*/
export const getSmithyContext = (context: HandlerExecutionContext): Record<string, unknown> =>
context[SMITHY] || (context[SMITHY] = {});
4 changes: 4 additions & 0 deletions packages/util-middleware/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @internal
*/
export * from "./getSmithyContext"
/**
* @internal
*/
Expand Down

0 comments on commit c47b765

Please sign in to comment.