mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): Remove linting exceptions in nodes-base (#4794)
* ⚡ enabled array-type * ⚡ await-thenable on * ⚡ ban-types on * ⚡ default-param-last on * ⚡ dot-notation on * ⚡ member-delimiter-style on * ⚡ no-duplicate-imports on * ⚡ no-empty-interface on * ⚡ no-floating-promises on * ⚡ no-for-in-array on * ⚡ no-invalid-void-type on * ⚡ no-loop-func on * ⚡ no-shadow on * ⚡ ban-ts-comment re enabled * ⚡ @typescript-eslint/lines-between-class-members on * address my own comment * @typescript-eslint/return-await on * @typescript-eslint/promise-function-async on * @typescript-eslint/no-unnecessary-boolean-literal-compare on * @typescript-eslint/no-unnecessary-type-assertion on * prefer-const on * @typescript-eslint/prefer-optional-chain on Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { get, set, unset } from 'lodash';
|
||||
|
||||
import { BINARY_ENCODING } from 'n8n-core';
|
||||
import { BINARY_ENCODING, IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import { IExecuteFunctions } from 'n8n-core';
|
||||
import {
|
||||
deepCopy,
|
||||
IBinaryData,
|
||||
@@ -331,7 +330,7 @@ export class MoveBinaryData implements INodeType {
|
||||
let options: IDataObject;
|
||||
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
||||
item = items[itemIndex];
|
||||
options = this.getNodeParameter('options', itemIndex, {}) as IDataObject;
|
||||
options = this.getNodeParameter('options', itemIndex, {});
|
||||
|
||||
// Copy the whole JSON data as data on any level can be renamed
|
||||
newItem = {
|
||||
@@ -358,7 +357,7 @@ export class MoveBinaryData implements INodeType {
|
||||
|
||||
let convertedValue: string;
|
||||
|
||||
if (setAllData === true) {
|
||||
if (setAllData) {
|
||||
// Set the full data
|
||||
convertedValue = iconv.decode(buffer, encoding, {
|
||||
stripBOM: options.stripBOM as boolean,
|
||||
@@ -398,7 +397,7 @@ export class MoveBinaryData implements INodeType {
|
||||
|
||||
const encoding = (options.encoding as string) || 'utf8';
|
||||
let value: IDataObject | string = item.json;
|
||||
if (convertAllData === false) {
|
||||
if (!convertAllData) {
|
||||
const sourceKey = this.getNodeParameter('sourceKey', itemIndex) as string;
|
||||
value = get(item.json, sourceKey) as IDataObject;
|
||||
}
|
||||
@@ -435,7 +434,7 @@ export class MoveBinaryData implements INodeType {
|
||||
convertedValue.fileName = options.fileName as string;
|
||||
}
|
||||
|
||||
set(newItem.binary!, destinationKey, convertedValue);
|
||||
set(newItem.binary, destinationKey, convertedValue);
|
||||
|
||||
if (options.keepSource === true) {
|
||||
// JSON data does not get touched so simply reference it
|
||||
@@ -443,7 +442,7 @@ export class MoveBinaryData implements INodeType {
|
||||
} else {
|
||||
// JSON data will change so copy it
|
||||
|
||||
if (convertAllData === true) {
|
||||
if (convertAllData) {
|
||||
// Data should not be kept and all data got converted. So simply set new as empty
|
||||
newItem.json = {};
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user