n8n-3867-progressively-apply-prettier-to-all (#3873)

* 🔨 formatting nodes with prettier
This commit is contained in:
Michael Kret
2022-08-17 18:50:24 +03:00
committed by GitHub
parent f2d326c7f0
commit 91d7e16c81
1072 changed files with 42357 additions and 59109 deletions

View File

@@ -36,18 +36,15 @@ export class RssFeedRead implements INodeType {
],
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
try{
try {
const url = this.getNodeParameter('url', 0) as string;
if (!url) {
throw new NodeOperationError(this.getNode(), 'The parameter "URL" has to be set!');
}
if (!validateURL(url)){
if (!validateURL(url)) {
throw new NodeOperationError(this.getNode(), 'The provided "URL" is not valid!');
}
@@ -58,13 +55,15 @@ export class RssFeedRead implements INodeType {
feed = await parser.parseURL(url);
} catch (error) {
if (error.code === 'ECONNREFUSED') {
throw new NodeOperationError(this.getNode(), `It was not possible to connect to the URL. Please make sure the URL "${url}" it is valid!`);
throw new NodeOperationError(
this.getNode(),
`It was not possible to connect to the URL. Please make sure the URL "${url}" it is valid!`,
);
}
throw new NodeOperationError(this.getNode(), error);
}
const returnData: IDataObject[] = [];
// For now we just take the items and ignore everything else
@@ -76,10 +75,9 @@ export class RssFeedRead implements INodeType {
}
return [this.helpers.returnJsonArray(returnData)];
} catch (error) {
if (this.continueOnFail()) {
return this.prepareOutputData([{json:{ error: error.message }}]);
return this.prepareOutputData([{ json: { error: error.message } }]);
}
throw error;
}
@@ -88,7 +86,7 @@ export class RssFeedRead implements INodeType {
// Utility function
function validateURL (url: string) {
function validateURL(url: string) {
try {
const parseUrl = new URL(url);
return true;