refactor(core): Remove linting exceptions in nodes-base (#4794)

*  enabled array-type

*  await-thenable on

*  ban-types on

*  default-param-last on

*  dot-notation on

*  member-delimiter-style on

*  no-duplicate-imports on

*  no-empty-interface on

*  no-floating-promises on

*  no-for-in-array on

*  no-invalid-void-type on

*  no-loop-func on

*  no-shadow on

*  ban-ts-comment re enabled

*  @typescript-eslint/lines-between-class-members on

* address my own comment

* @typescript-eslint/return-await on

* @typescript-eslint/promise-function-async on

* @typescript-eslint/no-unnecessary-boolean-literal-compare on

* @typescript-eslint/no-unnecessary-type-assertion on

* prefer-const on

* @typescript-eslint/prefer-optional-chain on

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Michael Kret
2022-12-02 22:54:28 +02:00
committed by GitHub
parent 8101c05d6f
commit 61e26804ba
796 changed files with 3735 additions and 2847 deletions

View File

@@ -194,16 +194,16 @@ export class AwsDynamoDB implements INodeType {
const additionalFields = this.getNodeParameter('additionalFields', i);
const simple = this.getNodeParameter('simple', 0, false) as boolean;
const items = this.getNodeParameter('keysUi.keyValues', i, []) as [
const keyValues = this.getNodeParameter('keysUi.keyValues', i, []) as [
{ key: string; type: string; value: string },
];
for (const item of items) {
for (const item of keyValues) {
let value = item.value as NodeParameterValue;
// All data has to get send as string even numbers
// @ts-ignore
value = ![null, undefined].includes(value) ? value?.toString() : '';
body.Key[item.key as string] = { [item.type as string]: value };
body.Key[item.key] = { [item.type]: value };
}
const expressionAttributeValues = adjustExpressionAttributeValues(eavUi);
@@ -231,7 +231,7 @@ export class AwsDynamoDB implements INodeType {
if (!Object.keys(responseData).length) {
responseData = { success: true };
} else if (simple === true) {
} else if (simple) {
responseData = decodeItem(responseData.Attributes);
}
} else if (operation === 'get') {
@@ -273,9 +273,9 @@ export class AwsDynamoDB implements INodeType {
body.ProjectionExpression = additionalFields.projectionExpression as string;
}
const items = this.getNodeParameter('keysUi.keyValues', i, []) as IDataObject[];
const keyValues = this.getNodeParameter('keysUi.keyValues', i, []) as IDataObject[];
for (const item of items) {
for (const item of keyValues) {
let value = item.value as NodeParameterValue;
// All data has to get send as string even numbers
// @ts-ignore
@@ -317,13 +317,13 @@ export class AwsDynamoDB implements INodeType {
TableName: this.getNodeParameter('tableName', i) as string,
};
if (scan === true) {
if (scan) {
const filterExpression = this.getNodeParameter('filterExpression', i) as string;
if (filterExpression) {
body['FilterExpression'] = filterExpression;
body.FilterExpression = filterExpression;
}
} else {
body['KeyConditionExpression'] = this.getNodeParameter(
body.KeyConditionExpression = this.getNodeParameter(
'keyConditionExpression',
i,
) as string;
@@ -371,7 +371,7 @@ export class AwsDynamoDB implements INodeType {
'X-Amz-Target': scan ? 'DynamoDB_20120810.Scan' : 'DynamoDB_20120810.Query',
};
if (returnAll === true && select !== 'COUNT') {
if (returnAll && select !== 'COUNT') {
responseData = await awsApiRequestAllItems.call(
this,
'dynamodb',
@@ -387,7 +387,7 @@ export class AwsDynamoDB implements INodeType {
responseData = responseData.Items;
}
}
if (simple === true) {
if (simple) {
responseData = responseData.map(simplify);
}
}