Skip to content

Commit 1fc37f8

Browse files
committed
chore: fix formatting and add changeset
1 parent 13fd0f0 commit 1fc37f8

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.changeset/stale-phones-behave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@smithy/middleware-endpoint": minor
3+
---
4+
5+
handle clientContextParam collisions with builtin config keys

packages/middleware-endpoint/src/adaptors/createConfigValueProvider.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ export const createConfigValueProvider = <Config extends Record<string, unknown>
2121
// Check clientContextParams first for client context parameters
2222
const clientContextParams = config.clientContextParams as Record<string, unknown> | undefined;
2323
const nestedValue: unknown = clientContextParams?.[configKey] ?? clientContextParams?.[canonicalEndpointParamKey];
24-
25-
// Fall back to direct config properties
24+
// Fall back to direct config properties
2625
const configValue: unknown = nestedValue ?? config[configKey] ?? config[canonicalEndpointParamKey];
27-
2826
if (typeof configValue === "function") {
2927
return configValue();
3028
}

packages/middleware-endpoint/src/adaptors/getEndpointFromInstructions.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,11 @@ export const resolveParams = async <
7878
instructionsSupplier: EndpointParameterInstructionsSupplier,
7979
clientConfig: Partial<EndpointResolvedConfig<T>> & Config
8080
) => {
81-
// Initialize clientContextParams to empty object if undefined
82-
// when accessing nested properties during parameter resolution
81+
// Initialize clientContextParams to empty object if undefined
8382
const config = clientConfig as typeof clientConfig & { clientContextParams?: Record<string, unknown> };
8483
if (config.clientContextParams === undefined) {
8584
config.clientContextParams = {};
8685
}
87-
8886
const endpointParams: EndpointParameters = {};
8987
const instructions: EndpointParameterInstructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {};
9088

0 commit comments

Comments
 (0)