Skip to content

Commit 1dec562

Browse files
committed
chore(packages): use Record in place of Object
1 parent bb9f18e commit 1dec562

File tree

39 files changed

+53
-53
lines changed

39 files changed

+53
-53
lines changed

packages/config-resolver/src/endpointsConfig/NodeUseDualstackEndpointConfigOptions.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe("NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS", () => {
1414
jest.clearAllMocks();
1515
});
1616

17-
const test = (func: Function, obj: { [key: string]: string }, key: string, type: SelectorType) => {
17+
const test = (func: Function, obj: Record<string, string>, key: string, type: SelectorType) => {
1818
it.each([true, false, undefined])("returns %s", (output) => {
1919
(booleanSelector as jest.Mock).mockReturnValueOnce(output);
2020
expect(func(obj)).toEqual(output);

packages/config-resolver/src/endpointsConfig/NodeUseFipsEndpointConfigOptions.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe("NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS", () => {
1414
jest.clearAllMocks();
1515
});
1616

17-
const test = (func: Function, obj: { [key: string]: string }, key: string, type: SelectorType) => {
17+
const test = (func: Function, obj: Record<string, string>, key: string, type: SelectorType) => {
1818
it.each([true, false, undefined])("returns %s", (output) => {
1919
(booleanSelector as jest.Mock).mockReturnValueOnce(output);
2020
expect(func(obj)).toEqual(output);

packages/credential-provider-cognito-identity/src/InMemoryStorage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Storage } from "./Storage";
22

33
export class InMemoryStorage implements Storage {
4-
constructor(private store: { [key: string]: string } = {}) {}
4+
constructor(private store: Record<string, string> = {}) {}
55

66
getItem(key: string): string | null {
77
if (key in this.store) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const resolveAssumeRoleCredentials = async (
6868
profileName: string,
6969
profiles: ParsedIniData,
7070
options: FromIniInit,
71-
visitedProfiles: { [profileName: string]: true } = {}
71+
visitedProfiles: Record<string, true> = {}
7272
) => {
7373
const data = profiles[profileName];
7474

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const resolveProfileData = async (
1111
profileName: string,
1212
profiles: ParsedIniData,
1313
options: FromIniInit,
14-
visitedProfiles: { [profileName: string]: true } = {}
14+
visitedProfiles: Record<string, true> = {}
1515
): Promise<Credentials> => {
1616
const data = profiles[profileName];
1717

packages/eventstream-serde-browser/src/EventStreamMarshaller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class EventStreamMarshaller {
4040

4141
deserialize<T>(
4242
body: ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>,
43-
deserializer: (input: { [event: string]: Message }) => Promise<T>
43+
deserializer: (input: Record<string, Message>) => Promise<T>
4444
): AsyncIterable<T> {
4545
const bodyIterable = isReadableStream(body) ? readableStreamtoIterable(body) : body;
4646
return this.universalMarshaller.deserialize(bodyIterable, deserializer);

packages/eventstream-serde-node/src/EventStreamMarshaller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class EventStreamMarshaller {
2323
});
2424
}
2525

26-
deserialize<T>(body: Readable, deserializer: (input: { [event: string]: Message }) => Promise<T>): AsyncIterable<T> {
26+
deserialize<T>(body: Readable, deserializer: (input: Record<string, Message>) => Promise<T>): AsyncIterable<T> {
2727
//should use stream[Symbol.asyncIterable] when the api is stable
2828
//reference: https://nodejs.org/docs/latest-v11.x/api/stream.html#stream_readable_symbol_asynciterator
2929
const bodyIterable: AsyncIterable<Uint8Array> =

packages/eventstream-serde-universal/src/EventStreamMarshaller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class EventStreamMarshaller {
2121

2222
deserialize<T>(
2323
body: AsyncIterable<Uint8Array>,
24-
deserializer: (input: { [event: string]: Message }) => Promise<T>
24+
deserializer: (input: Record<string, Message>) => Promise<T>
2525
): AsyncIterable<T> {
2626
const chunkedStream = getChunkedStream(body);
2727
const unmarshalledStream = getUnmarshalledStream(chunkedStream, {

packages/eventstream-serde-universal/src/getUnmarshalledStream.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { Encoder, Message } from "@aws-sdk/types";
33

44
export type UnmarshalledStreamOptions<T> = {
55
eventMarshaller: EventMarshaller;
6-
deserializer: (input: { [name: string]: Message }) => Promise<T>;
6+
deserializer: (input: Record<string, Message>) => Promise<T>;
77
toUtf8: Encoder;
88
};
99

10-
export function getUnmarshalledStream<T extends { [key: string]: any }>(
10+
export function getUnmarshalledStream<T extends Record<string, any>>(
1111
source: AsyncIterable<Uint8Array>,
1212
options: UnmarshalledStreamOptions<T>
1313
): AsyncIterable<T> {

packages/middleware-bucket-endpoint/src/NodeDisableMultiregionAccessPointConfigOptions.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe("NODE_USE_ARN_REGION_CONFIG_OPTIONS", () => {
1313
jest.clearAllMocks();
1414
});
1515

16-
const test = (func: Function, obj: { [key: string]: string }, key: string, type: SelectorType) => {
16+
const test = (func: Function, obj: Record<string, string>, key: string, type: SelectorType) => {
1717
it.each([true, false, undefined])("returns %s", (output) => {
1818
(booleanSelector as jest.Mock).mockReturnValueOnce(output);
1919
expect(func(obj)).toEqual(output);

packages/middleware-bucket-endpoint/src/NodeUseArnRegionConfigOptions.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe("NODE_USE_ARN_REGION_CONFIG_OPTIONS", () => {
1313
jest.clearAllMocks();
1414
});
1515

16-
const test = (func: Function, obj: { [key: string]: string }, key: string, type: SelectorType) => {
16+
const test = (func: Function, obj: Record<string, string>, key: string, type: SelectorType) => {
1717
it.each([true, false, undefined])("returns %s", (output) => {
1818
(booleanSelector as jest.Mock).mockReturnValueOnce(output);
1919
expect(func(obj)).toEqual(output);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const getCacheKey = async (
77
commandName: string,
88
config: { credentials: Provider<Credentials> },
99
options: {
10-
identifiers?: { [key: string]: string };
10+
identifiers?: Record<string, string>;
1111
}
1212
) => {
1313
const { accessKeyId } = await config.credentials();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface EndpointDiscoveryMiddlewareConfig {
1414
isDiscoveredEndpointRequired: boolean;
1515
clientStack: MiddlewareStack<any, any>;
1616
options?: HttpHandlerOptions;
17-
identifiers?: { [key: string]: string };
17+
identifiers?: Record<string, string>;
1818
}
1919

2020
export const getEndpointDiscoveryPlugin = (

packages/middleware-sdk-eventbridge/src/inject-endpoint-id.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe("injectEndpointIdMiddleware", () => {
1616

1717
const invokeMiddleware = async (
1818
config: InjectEndpointIdMiddlewareConfig
19-
): Promise<{ hostname: string; middlewareContext: { [key: string]: any } }> => {
19+
): Promise<{ hostname: string; middlewareContext: Record<string, any> }> => {
2020
const mockNextHandler = jest.fn();
2121
const middlewareContext = {} as any;
2222
const handler = injectEndpointIdMiddleware({ ...config })(mockNextHandler, middlewareContext);

packages/middleware-sdk-rds/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { formatUrl } from "@aws-sdk/util-format-url";
1818

1919
const regARN = /arn:[\w+=/,.@-]+:[\w+=/,.@-]+:([\w+=/,.@-]*)?:[0-9]+:[\w+=/,.@-]+(:[\w+=/,.@-]+)?(:[\w+=/,.@-]+)?/;
2020

21-
const sourceIdToCommandKeyMap: { [key: string]: string } = {
21+
const sourceIdToCommandKeyMap: Record<string, string> = {
2222
SourceDBSnapshotIdentifier: "CopyDBSnapshot",
2323
SourceDBInstanceIdentifier: "CreateDBInstanceReadReplica",
2424
ReplicationSourceIdentifier: "CreateDBCluster", // This key is optional.

packages/middleware-sdk-sqs/src/send-message-batch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const sendMessageBatchMiddleware =
2828
const resp = await next({ ...args });
2929
const output = resp.output as unknown as SendMessageBatchResult;
3030
const messageIds = [];
31-
const entries: { [index: string]: SendMessageBatchResultEntry } = {};
31+
const entries: Record<string, SendMessageBatchResultEntry> = {};
3232
if (output.Successful !== undefined) {
3333
for (const entry of output.Successful) {
3434
if (entry.Id !== undefined) {

packages/s3-presigned-post/src/createPresignedPost.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
} from "./constants";
1515
import { Conditions as PolicyEntry } from "./types";
1616

17-
type Fields = { [key: string]: string };
17+
type Fields = Record<string, string>;
1818

1919
export interface PresignedPostOptions {
2020
Bucket: string;

packages/s3-presigned-post/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
type EqualCondition = ["eq", string, string] | { [key: string]: string };
1+
type EqualCondition = ["eq", string, string] | Record<string, string>;
22

33
type StartsWithCondition = ["starts-with", string, string];
44

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

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe(parseIni.name, () => {
1212
const mockProfileName = "mock_profile_name";
1313
const mockProfileData = { key: "value" };
1414

15-
const getMockProfileData = (profileName: string, profileData: { [key: string]: string }) =>
15+
const getMockProfileData = (profileName: string, profileData: Record<string, string>) =>
1616
`[${profileName}]\n${Object.entries(profileData)
1717
.map(([key, value]) => `${key} = ${value}`)
1818
.join("\n")}\n`;

packages/shared-ini-file-loader/src/slurpFile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { promises as fsPromises } from "fs";
33

44
const { readFile } = fsPromises;
55

6-
const filePromisesHash: { [key: string]: Promise<string> } = {};
6+
const filePromisesHash: Record<string, Promise<string>> = {};
77

88
export const slurpFile = (path: string) => {
99
if (!filePromisesHash[path]) {

packages/signature-v4/src/credentialDerivation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { toHex } from "@aws-sdk/util-hex-encoding";
33

44
import { KEY_TYPE_IDENTIFIER, MAX_CACHE_SIZE } from "./constants";
55

6-
const signingKeyCache: { [key: string]: Uint8Array } = {};
6+
const signingKeyCache: Record<string, Uint8Array> = {};
77
const cacheQueue: Array<string> = [];
88

99
/**

packages/signature-v4/src/getCanonicalQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { SIGNATURE_HEADER } from "./constants";
88
*/
99
export const getCanonicalQuery = ({ query = {} }: HttpRequest): string => {
1010
const keys: Array<string> = [];
11-
const serialized: { [key: string]: string } = {};
11+
const serialized: Record<string, string> = {};
1212
for (const key of Object.keys(query).sort()) {
1313
if (key.toLowerCase() === SIGNATURE_HEADER) {
1414
continue;

packages/smithy-client/src/exceptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class ServiceException extends Error implements SmithyException, Metadata
4343
*/
4444
export const decorateServiceException = <E extends ServiceException>(
4545
exception: E,
46-
additions: { [key: string]: any } = {}
46+
additions: Record<string, any> = {}
4747
): E => {
4848
// apply additional properties to deserialized ServiceException object
4949
Object.entries(additions)

packages/smithy-client/src/parse-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export const expectNonNull = <T>(value: T | null | undefined, location?: string)
195195
* @returns The value if it's an object, undefined if it's null/undefined,
196196
* otherwise an error is thrown.
197197
*/
198-
export const expectObject = (value: any): { [key: string]: any } | undefined => {
198+
export const expectObject = (value: any): Record<string, any> | undefined => {
199199
if (value === null || value === undefined) {
200200
return undefined;
201201
}
@@ -231,7 +231,7 @@ export const expectString = (value: any): string | undefined => {
231231
* @return the value if it's a union, undefined if it's null/undefined, otherwise
232232
* an error is thrown.
233233
*/
234-
export const expectUnion = (value: unknown): { [key: string]: any } | undefined => {
234+
export const expectUnion = (value: unknown): Record<string, any> | undefined => {
235235
if (value === null || value === undefined) {
236236
return undefined;
237237
}

packages/types/src/eventStream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export interface EventStreamSerdeContext {
9090
}
9191

9292
export interface EventStreamMarshaller {
93-
deserialize: (body: any, deserializer: (input: { [event: string]: Message }) => any) => AsyncIterable<any>;
93+
deserialize: (body: any, deserializer: (input: Record<string, Message>) => any) => AsyncIterable<any>;
9494
serialize: (input: AsyncIterable<any>, serializer: (event: any) => Message) => any;
9595
}
9696

packages/types/src/shapes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { MetadataBearer } from "./response";
99
* document types and they SHOULD serialize document types inline as normal
1010
* JSON values.
1111
*/
12-
export type DocumentType = null | boolean | number | string | DocumentType[] | { [prop: string]: DocumentType };
12+
export type DocumentType = null | boolean | number | string | DocumentType[] | Record<string, DocumentType>;
1313

1414
/**
1515
* A structure shape with the error trait.

packages/util-base64-browser/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const alphabetByEncoding: { [key: string]: number } = {};
1+
const alphabetByEncoding: Record<string, number> = {};
22
const alphabetByValue: Array<string> = new Array(64);
33

44
for (let i = 0, start = "A".charCodeAt(0), limit = "Z".charCodeAt(0); i + start <= limit; i++) {

packages/util-dynamodb/src/convertToAttr.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ describe("convertToAttr", () => {
349349
stringSet: { SS: ["one", "two", "three"] },
350350
},
351351
},
352-
] as { input: { [key: string]: NativeAttributeValue }; output: { [key: string]: AttributeValue } }[]
352+
] as { input: Record<string, NativeAttributeValue>; output: Record<string, AttributeValue> }[]
353353
).forEach(({ input, output }) => {
354354
[true, false].forEach((useObjectCreate) => {
355355
const inputObject = useObjectCreate ? Object.create(input) : input;
@@ -506,7 +506,7 @@ describe("convertToAttr", () => {
506506
private readonly bigintAttr: bigint,
507507
private readonly binaryAttr: Uint8Array,
508508
private readonly listAttr: any[],
509-
private readonly mapAttr: { [key: string]: any }
509+
private readonly mapAttr: Record<string, any>
510510
) {}
511511
public exampleMethod() {
512512
return "This method won't be marshalled";

packages/util-dynamodb/src/convertToAttr.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const convertToAttr = (data: NativeAttributeValue, options?: marshallOpti
2525
// for object which is result of Object.create(null), which doesn't have constructor defined
2626
(!data.constructor && typeof data === "object")
2727
) {
28-
return convertToMapAttrFromEnumerableProps(data as { [key: string]: NativeAttributeValue }, options);
28+
return convertToMapAttrFromEnumerableProps(data as Record<string, NativeAttributeValue>, options);
2929
} else if (isBinary(data)) {
3030
if (data.length === 0 && options?.convertEmptyValues) {
3131
return convertToNullAttr();
@@ -45,7 +45,7 @@ export const convertToAttr = (data: NativeAttributeValue, options?: marshallOpti
4545
}
4646
return convertToStringAttr(data);
4747
} else if (options?.convertClassInstanceToMap && typeof data === "object") {
48-
return convertToMapAttrFromEnumerableProps(data as { [key: string]: NativeAttributeValue }, options);
48+
return convertToMapAttrFromEnumerableProps(data as Record<string, NativeAttributeValue>, options);
4949
}
5050
throw new Error(
5151
`Unsupported type passed: ${data}. Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.`
@@ -110,9 +110,9 @@ const convertToSetAttr = (
110110
const convertToMapAttrFromIterable = (
111111
data: Map<string, NativeAttributeValue>,
112112
options?: marshallOptions
113-
): { M: { [key: string]: AttributeValue } } => ({
113+
): { M: Record<string, AttributeValue> } => ({
114114
M: ((data) => {
115-
const map: { [key: string]: AttributeValue } = {};
115+
const map: Record<string, AttributeValue> = {};
116116
for (const [key, value] of data) {
117117
if (typeof value !== "function" && (value !== undefined || !options?.removeUndefinedValues)) {
118118
map[key] = convertToAttr(value, options);
@@ -123,11 +123,11 @@ const convertToMapAttrFromIterable = (
123123
});
124124

125125
const convertToMapAttrFromEnumerableProps = (
126-
data: { [key: string]: NativeAttributeValue },
126+
data: Record<string, NativeAttributeValue>,
127127
options?: marshallOptions
128-
): { M: { [key: string]: AttributeValue } } => ({
128+
): { M: Record<string, AttributeValue> } => ({
129129
M: ((data) => {
130-
const map: { [key: string]: AttributeValue } = {};
130+
const map: Record<string, AttributeValue> = {};
131131
for (const key in data) {
132132
const value = data[key];
133133
if (typeof value !== "function" && (value !== undefined || !options?.removeUndefinedValues)) {

packages/util-dynamodb/src/convertToAttrToNative.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ describe("convertToAttrToNative", () => {
197197
binarySet: new Set([uint8Arr, biguintArr]),
198198
stringSet: new Set(["one", "two", "three"]),
199199
},
200-
] as { [key: string]: NativeAttributeValue }[]
200+
] as Record<string, NativeAttributeValue>[]
201201
).forEach((input) => {
202202
it(`testing map: ${input}`, () => {
203203
expect(convertToNative(convertToAttr(input))).toEqual(input);

packages/util-dynamodb/src/convertToNative.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ describe("convertToNative", () => {
202202
stringSet: new Set(["one", "two", "three"]),
203203
},
204204
},
205-
] as { input: { [key: string]: AttributeValue }; output: { [key: string]: NativeAttributeValue } }[]
205+
] as { input: Record<string, AttributeValue>; output: Record<string, NativeAttributeValue> }[]
206206
).forEach(({ input, output }) => {
207207
it(`testing map: ${input}`, () => {
208208
expect(convertToNative({ M: input })).toEqual(output);

packages/util-dynamodb/src/convertToNative.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const convertToNative = (data: AttributeValue, options?: unmarshallOption
2626
case "L":
2727
return convertList(value as AttributeValue[], options);
2828
case "M":
29-
return convertMap(value as { [key: string]: AttributeValue }, options);
29+
return convertMap(value as Record<string, AttributeValue>, options);
3030
case "NS":
3131
return new Set((value as string[]).map((item) => convertNumber(item, options)));
3232
case "BS":
@@ -70,11 +70,11 @@ const convertList = (list: AttributeValue[], options?: unmarshallOptions): Nativ
7070
list.map((item) => convertToNative(item, options));
7171

7272
const convertMap = (
73-
map: { [key: string]: AttributeValue },
73+
map: Record<string, AttributeValue>,
7474
options?: unmarshallOptions
75-
): { [key: string]: NativeAttributeValue } =>
75+
): Record<string, NativeAttributeValue> =>
7676
Object.entries(map).reduce(
77-
(acc: { [key: string]: NativeAttributeValue }, [key, value]: [string, AttributeValue]) => ({
77+
(acc: Record<string, NativeAttributeValue>, [key, value]: [string, AttributeValue]) => ({
7878
...acc,
7979
[key]: convertToNative(value, options),
8080
}),

packages/util-dynamodb/src/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface NumberValue {
1212

1313
export type NativeAttributeValue =
1414
| NativeScalarAttributeValue
15-
| { [key: string]: NativeAttributeValue }
15+
| Record<string, NativeAttributeValue>
1616
| NativeAttributeValue[]
1717
| Set<number | bigint | NumberValue | string | NativeAttributeBinary | undefined>
1818
| InstanceType<{ new (...args: any[]): any }>; // accepts any class instance with options.convertClassInstanceToMap

packages/util-dynamodb/src/unmarshall.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface unmarshallOptions {
2121
* @param {unmarshallOptions} options - An optional configuration object for `unmarshall`
2222
*/
2323
export const unmarshall = (
24-
data: { [key: string]: AttributeValue },
24+
data: Record<string, AttributeValue>,
2525
options?: unmarshallOptions
26-
): { [key: string]: NativeAttributeValue } =>
27-
convertToNative({ M: data }, options) as { [key: string]: NativeAttributeValue };
26+
): Record<string, NativeAttributeValue> =>
27+
convertToNative({ M: data }, options) as Record<string, NativeAttributeValue>;

packages/util-hex-encoding/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const SHORT_TO_HEX: { [key: number]: string } = {};
2-
const HEX_TO_SHORT: { [key: string]: number } = {};
2+
const HEX_TO_SHORT: Record<string, number> = {};
33

44
for (let i = 0; i < 256; i++) {
55
let encodedByte = i.toString(16).toLowerCase();

packages/util-utf8-browser/src/pureJs.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { fromUtf8, toUtf8 } from "./pureJs";
22

3-
const utf8StringsToByteArrays: { [key: string]: Uint8Array } = {
3+
const utf8StringsToByteArrays: Record<string, Uint8Array> = {
44
ABC: new Uint8Array(["A".charCodeAt(0), "B".charCodeAt(0), "C".charCodeAt(0)]),
55
"🐎👱❤": new Uint8Array([240, 159, 144, 142, 240, 159, 145, 177, 226, 157, 164]),
66
"☃💩": new Uint8Array([226, 152, 131, 240, 159, 146, 169]),

0 commit comments

Comments
 (0)