refactor(core): Extract duplicate utility functions and add unit tests (no-changelog) (#9814)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-06-20 12:09:23 +02:00
committed by GitHub
parent 283d1ca583
commit e4463c62b4
14 changed files with 207 additions and 199 deletions

View File

@@ -6,9 +6,9 @@ import isEqual from 'lodash/isEqual';
import lt from 'lodash/lt';
import pick from 'lodash/pick';
import { compareItems, flattenKeys, prepareFieldsArray, typeToNumber } from '../../helpers/utils';
import { compareItems, flattenKeys, updateDisplayOptions } from '@utils/utilities';
import { prepareFieldsArray, typeToNumber } from '../../helpers/utils';
import { disableDotNotationBoolean } from '../common.descriptions';
import { updateDisplayOptions } from '@utils/utilities';
const properties: INodeProperties[] = [
{
@@ -229,7 +229,7 @@ export async function execute(
const removedIndexes: number[] = [];
let temp = newItems[0];
for (let index = 1; index < newItems.length; index++) {
if (compareItems(newItems[index], temp, keys, disableDotNotation, this.getNode())) {
if (compareItems(newItems[index], temp, keys, disableDotNotation)) {
removedIndexes.push(newItems[index].json.__INDEX as unknown as number);
} else {
temp = newItems[index];

View File

@@ -11,9 +11,9 @@ import get from 'lodash/get';
import isEqual from 'lodash/isEqual';
import lt from 'lodash/lt';
import { shuffleArray, sortByCode } from '../../helpers/utils';
import { sortByCode } from '../../helpers/utils';
import { disableDotNotationBoolean } from '../common.descriptions';
import { updateDisplayOptions } from '@utils/utilities';
import { shuffleArray, updateDisplayOptions } from '@utils/utilities';
const properties: INodeProperties[] = [
{