fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)

This commit is contained in:
Michael Kret
2023-02-28 05:39:43 +02:00
committed by GitHub
parent 3172ea376e
commit bb4db58819
560 changed files with 2227 additions and 1919 deletions

View File

@@ -9,7 +9,7 @@ import type {
} from 'n8n-core';
import { BINARY_ENCODING } from 'n8n-core';
import type { IDataObject } from 'n8n-workflow';
import type { JsonObject, IDataObject } from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
function getEnvironment(env: string) {
@@ -48,7 +48,7 @@ async function getAccessToken(
try {
return await this.helpers.request(options);
} catch (error) {
throw new NodeOperationError(this.getNode(), error);
throw new NodeOperationError(this.getNode(), error as Error);
}
}
@@ -84,7 +84,7 @@ export async function payPalApiRequest(
try {
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
@@ -119,9 +119,9 @@ export async function payPalApiRequestAllItems(
do {
responseData = await payPalApiRequest.call(this, endpoint, method, body, query, uri);
uri = getNext(responseData.links);
returnData.push.apply(returnData, responseData[propertyName]);
} while (getNext(responseData.links) !== undefined);
uri = getNext(responseData.links as IDataObject[]);
returnData.push.apply(returnData, responseData[propertyName] as IDataObject[]);
} while (getNext(responseData.links as IDataObject[]) !== undefined);
return returnData;
}