2025-11-13 13:13:34 -07:00

13 lines
668 B
JavaScript

import { EndpointCache } from "@aws-sdk/endpoint-cache";
export const resolveEndpointDiscoveryConfig = (input, { endpointDiscoveryCommandCtor }) => {
const { endpointCacheSize, endpointDiscoveryEnabled, endpointDiscoveryEnabledProvider } = input;
return Object.assign(input, {
endpointDiscoveryCommandCtor,
endpointCache: new EndpointCache(endpointCacheSize ?? 1000),
endpointDiscoveryEnabled: endpointDiscoveryEnabled !== undefined
? () => Promise.resolve(endpointDiscoveryEnabled)
: endpointDiscoveryEnabledProvider,
isClientEndpointDiscoveryEnabled: endpointDiscoveryEnabled !== undefined,
});
};