refactor(core): Introduce overload for number-type node parameter (no-changelog) (#4644)

* 📘 Set up overloads

* 📘 Add temporary assertion

* 🔥 Remove inferrable number assertions

* ✏️ Add ticket ref
This commit is contained in:
Iván Ovejero
2022-11-18 15:26:22 +01:00
committed by GitHub
parent 600b285a44
commit 0565194473
166 changed files with 783 additions and 689 deletions

View File

@@ -815,7 +815,7 @@ export class Dropbox implements INodeType {
};
if (returnAll === false) {
const limit = this.getNodeParameter('limit', 0) as number;
const limit = this.getNodeParameter('limit', 0);
body.limit = limit;
}
@@ -852,7 +852,7 @@ export class Dropbox implements INodeType {
Object.assign(body.options!, filters);
if (returnAll === false) {
const limit = this.getNodeParameter('limit', i) as number;
const limit = this.getNodeParameter('limit', i);
Object.assign(body.options!, { max_results: limit });
}
@@ -942,7 +942,7 @@ export class Dropbox implements INodeType {
const newItem: INodeExecutionData = {
json: items[i].json,
binary: {},
pairedItem: {item: i},
pairedItem: { item: i },
};
if (items[i].binary !== undefined) {
@@ -1000,9 +1000,9 @@ export class Dropbox implements INodeType {
} else if (resource === 'search' && operation === 'query') {
let data = responseData;
if (returnAll === true) {
data = (simple === true) ? simplify(responseData) : responseData;
data = simple === true ? simplify(responseData) : responseData;
} else {
data = (simple === true) ? simplify(responseData[property]) : responseData[property];
data = simple === true ? simplify(responseData[property]) : responseData[property];
}
const executionData = this.helpers.constructExecutionMetaData(
@@ -1023,7 +1023,7 @@ export class Dropbox implements INodeType {
if (resource === 'file' && operation === 'download') {
items[i].json = { error: error.message };
} else {
returnData.push({json: { error: error.message }});
returnData.push({ json: { error: error.message } });
}
continue;
}