Skip to content

Commit

Permalink
chore(lib-dynamodb): use correct types - generated client
Browse files Browse the repository at this point in the history
  • Loading branch information
pasoevi committed Jun 25, 2024
1 parent 576c827 commit 5a780fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions lib/lib-dynamodb/src/pagination/QueryPaginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const makePagedClientRequest = async (
input: QueryCommandInput,
...args: any
): Promise<QueryCommandOutput> => {
// @ts-ignore
return await client.send(new QueryCommand(input), ...args);
};
/**
Expand All @@ -32,8 +31,7 @@ export async function* paginateQuery(
input: QueryCommandInput,
...additionalArguments: any
): Paginator<QueryCommandOutput> {
// ToDo: replace with actual type instead of typeof input.ExclusiveStartKey
let token: typeof input.ExclusiveStartKey | undefined = config.startingToken || undefined;
let token: Record<string, NativeAttributeValue> | undefined = config.startingToken || undefined;
let hasNext = true;
let page: QueryCommandOutput;
while (hasNext) {
Expand All @@ -48,6 +46,5 @@ export async function* paginateQuery(
token = page.LastEvaluatedKey;
hasNext = !!token;
}
// @ts-ignore
return undefined;
}
5 changes: 1 addition & 4 deletions lib/lib-dynamodb/src/pagination/ScanPaginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const makePagedClientRequest = async (
input: ScanCommandInput,
...args: any
): Promise<ScanCommandOutput> => {
// @ts-ignore
return await client.send(new ScanCommand(input), ...args);
};
/**
Expand All @@ -32,8 +31,7 @@ export async function* paginateScan(
input: ScanCommandInput,
...additionalArguments: any
): Paginator<ScanCommandOutput> {
// ToDo: replace with actual type instead of typeof input.ExclusiveStartKey
let token: typeof input.ExclusiveStartKey | undefined = config.startingToken || undefined;
let token: Record<string, NativeAttributeValue> | undefined = config.startingToken || undefined;
let hasNext = true;
let page: ScanCommandOutput;
while (hasNext) {
Expand All @@ -48,6 +46,5 @@ export async function* paginateScan(
token = page.LastEvaluatedKey;
hasNext = !!token;
}
// @ts-ignore
return undefined;
}

0 comments on commit 5a780fb

Please sign in to comment.