ci: Fix linting issues on master (no-changelog) (#6186)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-05-05 08:22:49 +00:00 committed by GitHub
parent 13c143eb6d
commit 394c9a2731
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View file

@ -78,18 +78,20 @@ export class Code implements INodeType {
};
async execute(this: IExecuteFunctions) {
const nodeMode = this.getNodeParameter<CodeExecutionMode>('mode', 0);
const nodeMode = this.getNodeParameter('mode', 0) as CodeExecutionMode;
const workflowMode = this.getMode();
const language: CodeNodeEditorLanguage =
this.getNode()?.typeVersion === 2 ? this.getNodeParameter('language', 0) : 'javaScript';
this.getNode()?.typeVersion === 2
? (this.getNodeParameter('language', 0) as CodeNodeEditorLanguage)
: 'javaScript';
const codeParameterName = language === 'python' ? 'pythonCode' : 'jsCode';
const getSandbox = (index = 0) => {
const code = this.getNodeParameter<string>(codeParameterName, index);
const code = this.getNodeParameter(codeParameterName, index) as string;
const context = getSandboxContext.call(this, index);
if (language === 'python') {
const modules = this.getNodeParameter<string>('modules', index);
const modules = this.getNodeParameter('modules', index) as string;
const moduleImports: string[] = modules ? modules.split(',').map((m) => m.trim()) : [];
context.printOverwrite = workflowMode === 'manual' ? this.sendMessageToUI : null;
return new PythonSandbox(context, code, moduleImports, index, this.helpers);

View file

@ -636,12 +636,12 @@ namespace ExecuteFunctions {
fallbackValue?: number,
options?: IGetNodeParameterOptions,
): number;
getNodeParameter<T = NodeParameterValueType | object>(
getNodeParameter(
parameterName: string,
itemIndex: number,
fallbackValue?: any,
options?: IGetNodeParameterOptions,
): T;
): NodeParameterValueType | object;
};
}