refactor(core): Extract duplicate utility functions and add unit tests (no-changelog) (#9814)
This commit is contained in:
committed by
GitHub
parent
283d1ca583
commit
e4463c62b4
@@ -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];
|
||||
|
||||
@@ -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[] = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user