fix(AWS DynamoDB Node): Add missing type assertion (no-changelog) (#5003)

fix(AWS DynamoDB Node): add type assertion
This commit is contained in:
Csaba Tuncsik
2022-12-22 10:27:14 +01:00
committed by GitHub
parent 87d8865ad3
commit e4785da2e1
3 changed files with 25 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
import { deepCopy, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { deepCopy, IDataObject, INodeExecutionData, assert } from 'n8n-workflow';
import {
AdjustedPutItem,
@@ -82,7 +82,11 @@ function decodeAttribute(type: AttributeValueType, attribute: string | IAttribut
case 'NS':
return attribute;
case 'M':
return simplify(attribute as IAttributeValue);
assert(
typeof attribute === 'object' && !Array.isArray(attribute) && attribute !== null,
'Attribute must be an object',
);
return simplify(attribute);
default:
return null;
}