@aws-sdk/middleware-endpoint-discovery
Version:
[](https://www.npmjs.com/package/@aws-sdk/middleware-endpoint-discovery) [ • 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,
});
};