fix: DynamoDB node type issues (#5002)

This commit is contained in:
Omar Ajoue 2022-12-22 09:40:53 +01:00 committed by GitHub
parent a43ea177eb
commit 9568b747c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,7 +70,7 @@ export function simplify(item: IAttributeValue): IDataObject {
return output;
}
function decodeAttribute(type: AttributeValueType, attribute: string) {
function decodeAttribute(type: AttributeValueType, attribute: string | IAttributeValue) {
switch (type) {
case 'BOOL':
return Boolean(attribute);
@ -82,7 +82,7 @@ function decodeAttribute(type: AttributeValueType, attribute: string) {
case 'NS':
return attribute;
case 'M':
return simplify(attribute);
return simplify(attribute as IAttributeValue);
default:
return null;
}