Skip to content

Commit

Permalink
fix getItem
Browse files Browse the repository at this point in the history
  • Loading branch information
Moicky committed Feb 19, 2024
1 parent e6fa5b0 commit 77cac7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moicky/dynamodb",
"version": "2.4.3",
"version": "2.4.4",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"description": "Contains a collection of convenience functions for working with AWS DynamoDB",
Expand Down
4 changes: 3 additions & 1 deletion src/operations/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ export async function getItem<T extends DynamoDBItem = DynamoDBItem>(
TableName: args?.TableName || getDefaultTable(),
})
)
.then((res) => res?.Item && unmarshallWithOptions<T>(res.Item));
.then((res) =>
res?.Item ? unmarshallWithOptions<T>(res.Item) : undefined
);
}

type GetItemsArgs = Partial<
Expand Down

0 comments on commit 77cac7b

Please sign in to comment.