Skip to content

Commit

Permalink
fix find() return type - fixes #52
Browse files Browse the repository at this point in the history
  • Loading branch information
SamVerschueren committed Jul 13, 2017
1 parent 449c698 commit 3a19b56
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ export class Table {
return table.lookupName(this.tableName, this.dynamodb);
}

find(): Scan;
find(query: any, indexName?: string): Query;

/**
* Initialize a query builder.
*
* @param query The query for the index to filter on.
* @param indexName The name of the global secondary index.
*/
find(query?: any, indexName?: string): Scan | Query {
find(query?: any, indexName?: string) {
if (query === undefined) {
// If query is not provided, the caller wants to perform a full table scan.
return new Scan(this, this.dynamodb);
Expand Down

0 comments on commit 3a19b56

Please sign in to comment.