mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
👕 Fix lint issue
This commit is contained in:
parent
a251b47962
commit
04858c2933
|
@ -709,17 +709,17 @@ export class Wait implements INodeType {
|
||||||
|
|
||||||
let count = 0;
|
let count = 0;
|
||||||
for (const xfile of Object.keys(files)) {
|
for (const xfile of Object.keys(files)) {
|
||||||
const processFiles = [];
|
const processFiles: formidable.File[] = [];
|
||||||
let multiFile = false;
|
let multiFile = false;
|
||||||
if (Array.isArray(files[xfile])) {
|
if (Array.isArray(files[xfile])) {
|
||||||
processFiles.push(...files[xfile] as formidable.File[]);
|
processFiles.push(...files[xfile] as formidable.File[]);
|
||||||
multiFile = true;
|
multiFile = true;
|
||||||
} else {
|
} else {
|
||||||
processFiles.push(files[xfile]);
|
processFiles.push(files[xfile] as formidable.File);
|
||||||
}
|
}
|
||||||
|
|
||||||
let fileCount = 0;
|
let fileCount = 0;
|
||||||
for (const file in processFiles) {
|
for (const file of processFiles) {
|
||||||
let binaryPropertyName = xfile;
|
let binaryPropertyName = xfile;
|
||||||
if (binaryPropertyName.endsWith('[]')) {
|
if (binaryPropertyName.endsWith('[]')) {
|
||||||
binaryPropertyName = binaryPropertyName.slice(0, -2);
|
binaryPropertyName = binaryPropertyName.slice(0, -2);
|
||||||
|
@ -731,8 +731,8 @@ export class Wait implements INodeType {
|
||||||
binaryPropertyName = `${options.binaryPropertyName}${count}`;
|
binaryPropertyName = `${options.binaryPropertyName}${count}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileJson = (processFiles[file] as formidable.File).toJSON() as unknown as IDataObject;
|
const fileJson = file.toJSON() as unknown as IDataObject;
|
||||||
const fileContent = await fs.promises.readFile((processFiles[file] as formidable.File).path);
|
const fileContent = await fs.promises.readFile(file.path);
|
||||||
|
|
||||||
returnItem.binary![binaryPropertyName] = await this.helpers.prepareBinaryData(Buffer.from(fileContent), fileJson.name as string, fileJson.type as string);
|
returnItem.binary![binaryPropertyName] = await this.helpers.prepareBinaryData(Buffer.from(fileContent), fileJson.name as string, fileJson.type as string);
|
||||||
|
|
||||||
|
|
|
@ -424,17 +424,17 @@ export class Webhook implements INodeType {
|
||||||
|
|
||||||
let count = 0;
|
let count = 0;
|
||||||
for (const xfile of Object.keys(files)) {
|
for (const xfile of Object.keys(files)) {
|
||||||
const processFiles = [];
|
const processFiles: formidable.File[] = [];
|
||||||
let multiFile = false;
|
let multiFile = false;
|
||||||
if (Array.isArray(files[xfile])) {
|
if (Array.isArray(files[xfile])) {
|
||||||
processFiles.push(...files[xfile] as formidable.File[]);
|
processFiles.push(...files[xfile] as formidable.File[]);
|
||||||
multiFile = true;
|
multiFile = true;
|
||||||
} else {
|
} else {
|
||||||
processFiles.push(files[xfile]);
|
processFiles.push(files[xfile] as formidable.File);
|
||||||
}
|
}
|
||||||
|
|
||||||
let fileCount = 0;
|
let fileCount = 0;
|
||||||
for (const file in processFiles) {
|
for (const file of processFiles) {
|
||||||
let binaryPropertyName = xfile;
|
let binaryPropertyName = xfile;
|
||||||
if (binaryPropertyName.endsWith('[]')) {
|
if (binaryPropertyName.endsWith('[]')) {
|
||||||
binaryPropertyName = binaryPropertyName.slice(0, -2);
|
binaryPropertyName = binaryPropertyName.slice(0, -2);
|
||||||
|
@ -446,8 +446,8 @@ export class Webhook implements INodeType {
|
||||||
binaryPropertyName = `${options.binaryPropertyName}${count}`;
|
binaryPropertyName = `${options.binaryPropertyName}${count}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileJson = (processFiles[file] as formidable.File).toJSON() as unknown as IDataObject;
|
const fileJson = file.toJSON() as unknown as IDataObject;
|
||||||
const fileContent = await fs.promises.readFile((processFiles[file] as formidable.File).path);
|
const fileContent = await fs.promises.readFile(file.path);
|
||||||
|
|
||||||
returnItem.binary![binaryPropertyName] = await this.helpers.prepareBinaryData(Buffer.from(fileContent), fileJson.name as string, fileJson.type as string);
|
returnItem.binary![binaryPropertyName] = await this.helpers.prepareBinaryData(Buffer.from(fileContent), fileJson.name as string, fileJson.type as string);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue