@aws-sdk/middleware-endpoint-discovery
Version:
[](https://www.npmjs.com/package/@aws-sdk/middleware-endpoint-discovery) [ • 469 B
JavaScript
export const getCacheKey = async (commandName, config, options) => {
const { accessKeyId } = await config.credentials();
const { identifiers } = options;
return JSON.stringify({
...(accessKeyId && { accessKeyId }),
...(identifiers && {
commandName,
identifiers: Object.entries(identifiers)
.sort()
.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}),
}),
});
};