Skip to content

Commit

Permalink
fix(Table): resolve error with stringified limit (#503)
Browse files Browse the repository at this point in the history
Co-authored-by: Seth Orell <seth.orell@gmail.com>
  • Loading branch information
naorpeled and SethO committed Apr 11, 2023
1 parent 30a82ca commit f704d20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/table.query.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ describe('query', () => {
FilterExpression: '#attr1 = :attr1',
ProjectionExpression: '#proj1,#proj2,#proj3,#proj4',
IndexName: 'GSI1',
Limit: '10',
Limit: 10,
ScanIndexForward: false,
ConsistentRead: true,
ReturnConsumedCapacity: 'TOTAL',
Expand Down Expand Up @@ -166,7 +166,7 @@ describe('query', () => {
FilterExpression: '#attr1_0.#attr1_1.#attr1_2 = :attr1',
ProjectionExpression: '#proj1,#proj2,#proj3,#proj4',
IndexName: 'GSI1',
Limit: '10',
Limit: 10,
ScanIndexForward: false,
ConsistentRead: true,
ReturnConsumedCapacity: 'TOTAL',
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/table.scan.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('scan', () => {
IndexName: 'GSI1',
TotalSegments: 5,
Segment: 0,
Limit: '10',
Limit: 10,
ConsistentRead: true,
ReturnConsumedCapacity: 'TOTAL',
Select: 'ALL_ATTRIBUTES',
Expand Down
4 changes: 2 additions & 2 deletions src/classes/Table/Table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ class Table<Name extends string, PartitionKey extends A.Key, SortKey extends A.K
FilterExpression ? { FilterExpression } : null,
ProjectionExpression ? { ProjectionExpression } : null,
index ? { IndexName: index } : null,
limit ? { Limit: String(limit) } : null,
limit ? { Limit: limit } : null,
reverse ? { ScanIndexForward: !reverse } : null,
consistent ? { ConsistentRead: consistent } : null,
capacity ? { ReturnConsumedCapacity: capacity.toUpperCase() } : null,
Expand Down Expand Up @@ -953,7 +953,7 @@ class Table<Name extends string, PartitionKey extends A.Key, SortKey extends A.K
index ? { IndexName: index } : null,
segments ? { TotalSegments: segments } : null,
Number.isInteger(segment) ? { Segment: segment } : null,
limit ? { Limit: String(limit) } : null,
limit ? { Limit: limit } : null,
consistent ? { ConsistentRead: consistent } : null,
capacity ? { ReturnConsumedCapacity: capacity.toUpperCase() } : null,
select ? { Select: select.toUpperCase() } : null,
Expand Down

0 comments on commit f704d20

Please sign in to comment.