Skip to content

Commit 4846ee9

Browse files
committed
fix return type of handleQueryCommand
1 parent 641ecc7 commit 4846ee9

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dynadash",
3-
"version": "1.9.14",
3+
"version": "1.9.15",
44
"description": "DynamoDb helpers",
55
"main": "dist/index.js",
66
"types": "dist/types/index.d.ts",

src/query.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
import { Capacity, QueryCommand, QueryCommandInput, QueryCommandOutput } from "@aws-sdk/client-dynamodb";
1+
import type { QueryCommandInput, QueryCommandOutput } from "@aws-sdk/client-dynamodb";
2+
import { QueryCommand } from "@aws-sdk/client-dynamodb";
23
import { unmarshall } from "@aws-sdk/util-dynamodb";
34
import { initDdbClient } from "./client";
45
import { FilterExpressionMap, KeyCondExpressionMap } from "./types";
56
import { consoleError, getQueryExpression, mergeCapacityStats } from "./utils";
67

7-
export async function handleQueryCommand<R>(query: QueryCommandInput, batchCallback?: (rows: R[]) => Promise<any>) {
8+
export async function handleQueryCommand<R>(
9+
query: QueryCommandInput,
10+
batchCallback?: (rows: R[]) => Promise<any>,
11+
): Promise<
12+
{
13+
toJs: { (): R[]; <P>(transform: (row: R) => R | P): (R | P)[] };
14+
} & QueryCommandOutput
15+
> {
816
const client = initDdbClient();
917
try {
1018
let result: QueryCommandOutput | undefined = undefined;

0 commit comments

Comments
 (0)