mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
ci: Fix linting issues on master (no-changelog) (#6186)
This commit is contained in:
parent
13c143eb6d
commit
394c9a2731
|
@ -78,18 +78,20 @@ export class Code implements INodeType {
|
||||||
};
|
};
|
||||||
|
|
||||||
async execute(this: IExecuteFunctions) {
|
async execute(this: IExecuteFunctions) {
|
||||||
const nodeMode = this.getNodeParameter<CodeExecutionMode>('mode', 0);
|
const nodeMode = this.getNodeParameter('mode', 0) as CodeExecutionMode;
|
||||||
const workflowMode = this.getMode();
|
const workflowMode = this.getMode();
|
||||||
|
|
||||||
const language: CodeNodeEditorLanguage =
|
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 codeParameterName = language === 'python' ? 'pythonCode' : 'jsCode';
|
||||||
|
|
||||||
const getSandbox = (index = 0) => {
|
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);
|
const context = getSandboxContext.call(this, index);
|
||||||
if (language === 'python') {
|
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()) : [];
|
const moduleImports: string[] = modules ? modules.split(',').map((m) => m.trim()) : [];
|
||||||
context.printOverwrite = workflowMode === 'manual' ? this.sendMessageToUI : null;
|
context.printOverwrite = workflowMode === 'manual' ? this.sendMessageToUI : null;
|
||||||
return new PythonSandbox(context, code, moduleImports, index, this.helpers);
|
return new PythonSandbox(context, code, moduleImports, index, this.helpers);
|
||||||
|
|
|
@ -636,12 +636,12 @@ namespace ExecuteFunctions {
|
||||||
fallbackValue?: number,
|
fallbackValue?: number,
|
||||||
options?: IGetNodeParameterOptions,
|
options?: IGetNodeParameterOptions,
|
||||||
): number;
|
): number;
|
||||||
getNodeParameter<T = NodeParameterValueType | object>(
|
getNodeParameter(
|
||||||
parameterName: string,
|
parameterName: string,
|
||||||
itemIndex: number,
|
itemIndex: number,
|
||||||
fallbackValue?: any,
|
fallbackValue?: any,
|
||||||
options?: IGetNodeParameterOptions,
|
options?: IGetNodeParameterOptions,
|
||||||
): T;
|
): NodeParameterValueType | object;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue