Skip to content

Commit 59c7402

Browse files
committed
chore(paclages): convert Object to Record missed by RegEx
1 parent 1dec562 commit 59c7402

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

packages/config-resolver/src/regionInfo/PartitionHash.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import { EndpointVariant } from "./EndpointVariant";
55
* The information includes the list of regions belonging to that partition,
66
* and the hostname to be used for the partition.
77
*/
8-
export type PartitionHash = {
9-
[key: string]: {
8+
export type PartitionHash = Record<
9+
string,
10+
{
1011
regions: string[];
1112
regionRegex: string;
1213
variants: EndpointVariant[];
1314
endpoint?: string;
14-
};
15-
};
15+
}
16+
>;

packages/config-resolver/src/regionInfo/RegionHash.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import { EndpointVariant } from "./EndpointVariant";
44
* The hash of region with the information specific to that region.
55
* The information can include hostname, signingService and signingRegion.
66
*/
7-
export type RegionHash = {
8-
[key: string]: {
7+
export type RegionHash = Record<
8+
string,
9+
{
910
variants: EndpointVariant[];
1011
signingService?: string;
1112
signingRegion?: string;
12-
};
13-
};
13+
}
14+
>;

packages/credential-provider-ini/src/resolveCredentialSource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { CredentialProvider } from "@aws-sdk/types";
1111
* fromIni() is called.
1212
*/
1313
export const resolveCredentialSource = (credentialSource: string, profileName: string): CredentialProvider => {
14-
const sourceProvidersMap: { [name: string]: () => CredentialProvider } = {
14+
const sourceProvidersMap: Record<string, () => CredentialProvider> = {
1515
EcsContainer: fromContainerMetadata,
1616
Ec2InstanceMetadata: fromInstanceMetadata,
1717
Environment: fromEnv,

packages/middleware-endpoint-discovery/src/updateDiscoveredEndpointInCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface UpdateDiscoveredEndpointInCacheOptions extends EndpointDiscover
77
endpointDiscoveryCommandCtor: new (comandConfig: any) => any;
88
}
99

10-
const requestQueue: { [key: string]: { resolve: Function; reject: Function }[] } = {};
10+
const requestQueue: Record<string, { resolve: Function; reject: Function }[]> = {};
1111

1212
export const updateDiscoveredEndpointInCache = async (
1313
config: EndpointDiscoveryResolvedConfig & PreviouslyResolved,

packages/middleware-stack/src/MiddlewareStack.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ export const constructStack = <Input extends object, Output extends object>(): M
9898
const getMiddlewareList = (): Array<MiddlewareType<Input, Output>> => {
9999
const normalizedAbsoluteEntries: Normalized<AbsoluteMiddlewareEntry<Input, Output>, Input, Output>[] = [];
100100
const normalizedRelativeEntries: Normalized<RelativeMiddlewareEntry<Input, Output>, Input, Output>[] = [];
101-
const normalizedEntriesNameMap: {
102-
[middlewareName: string]: Normalized<MiddlewareEntry<Input, Output>, Input, Output>;
103-
} = {};
101+
const normalizedEntriesNameMap: Record<string, Normalized<MiddlewareEntry<Input, Output>, Input, Output>> = {};
104102

105103
absoluteEntries.forEach((entry) => {
106104
const normalizedEntry = {

packages/shared-ini-file-loader/src/getProfileData.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe(getProfileData.name, () => {
2929
const getMockOutput = (profileNames: string[]) =>
3030
profileNames.reduce((acc, profileName) => ({ ...acc, [profileName]: getMockProfileData(profileName) }), {});
3131

32-
const getMockInput = (mockOutput: { [key: string]: Record<string, string> }) =>
32+
const getMockInput = (mockOutput: Record<string, Record<string, string>>) =>
3333
Object.entries(mockOutput).reduce((acc, [key, value]) => ({ ...acc, [`profile ${key}`]: value }), {});
3434

3535
it("single profile", () => {

packages/util-config-provider/src/booleanSelector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export enum SelectorType {
1111
*
1212
* @internal
1313
*/
14-
export const booleanSelector = (obj: { [key: string]: string | undefined }, key: string, type: SelectorType) => {
14+
export const booleanSelector = (obj: Record<string, string | undefined>, key: string, type: SelectorType) => {
1515
if (!(key in obj)) return undefined;
1616
if (obj[key] === "true") return true;
1717
if (obj[key] === "false") return false;

0 commit comments

Comments
 (0)