13 lines
668 B
JavaScript
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,
|
|
});
|
|
};
|