mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Stringify all Luxon DateTimes in cleanupParameterData (#8959)
This commit is contained in:
@@ -30,6 +30,7 @@ import { tmpdir } from 'os';
|
||||
import { join } from 'path';
|
||||
import Container from 'typedi';
|
||||
import type { Agent } from 'https';
|
||||
import toPlainObject from 'lodash/toPlainObject';
|
||||
|
||||
const temporaryDir = mkdtempSync(join(tmpdir(), 'n8n'));
|
||||
|
||||
@@ -425,6 +426,16 @@ describe('NodeExecuteFunctions', () => {
|
||||
expect(typeof input.y).toBe('string');
|
||||
});
|
||||
|
||||
it('should stringify plain Luxon dates in-place', () => {
|
||||
const input = {
|
||||
x: 1,
|
||||
y: toPlainObject(DateTime.now()),
|
||||
};
|
||||
expect(typeof input.y).toBe('object');
|
||||
cleanupParameterData(input);
|
||||
expect(typeof input.y).toBe('string');
|
||||
});
|
||||
|
||||
it('should handle objects with nameless constructors', () => {
|
||||
const input = { x: 1, y: { constructor: {} } as NodeParameterValue };
|
||||
expect(typeof input.y).toBe('object');
|
||||
|
||||
Reference in New Issue
Block a user