fix(workflow): remove a few ts-ignore and eslint-disable (#3958)

fix(workflow): remove a few `ts-ignore` and `eslint-disable`. improve typing
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2022-09-09 16:34:50 +02:00
committed by GitHub
parent 712924cbc3
commit a73ac1d94f
9 changed files with 72 additions and 83 deletions

View File

@@ -352,7 +352,7 @@ export class WorkflowDataProxy {
}
return new Proxy(
{},
{ binary: undefined, data: undefined, json: undefined },
{
get(target, name, receiver) {
name = name.toString();
@@ -472,8 +472,7 @@ export class WorkflowDataProxy {
throw new Error(`The key "${name.toString()}" is not supported!`);
}
// @ts-ignore
return that.workflow[name.toString()];
return that.workflow[name as keyof typeof target];
},
},
);
@@ -1004,12 +1003,10 @@ export class WorkflowDataProxy {
return new Proxy(base, {
get(target, name, receiver) {
if (['$data', '$json'].includes(name as string)) {
// @ts-ignore
return that.nodeDataGetter(that.activeNodeName, true).json;
return that.nodeDataGetter(that.activeNodeName, true)?.json;
}
if (name === '$binary') {
// @ts-ignore
return that.nodeDataGetter(that.activeNodeName, true).binary;
return that.nodeDataGetter(that.activeNodeName, true)?.binary;
}
return Reflect.get(target, name, receiver);