fix(Item Lists Node): Don't check same type in remove duplicates operation (#7678)

Github issue / Community forum post (link here to close automatically):

---------

Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
Marcus
2023-11-21 13:10:59 +01:00
committed by GitHub
parent 366cd672a7
commit 4f307646f3
5 changed files with 334 additions and 16 deletions

View File

@@ -5,6 +5,7 @@ import type {
IBinaryData,
INode,
INodeExecutionData,
GenericValue,
} from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';
@@ -147,3 +148,22 @@ export function addBinariesToItem(
return newItem;
}
export function typeToNumber(value: GenericValue): number {
if (typeof value === 'object') {
if (Array.isArray(value)) return 9;
if (value === null) return 10;
if (value instanceof Date) return 11;
}
const types = {
_string: 1,
_number: 2,
_bigint: 3,
_boolean: 4,
_symbol: 5,
_undefined: 6,
_object: 7,
_function: 8,
};
return types[`_${typeof value}`];
}