UNPKG

@aws-sdk/middleware-endpoint-discovery

Version:

[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-endpoint-discovery/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-endpoint-discovery) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-endpoint-discovery.s

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