mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(core): Serialize dates and regexps when reading from augmented objects (#6086)
https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575
This commit is contained in:
committed by
GitHub
parent
390841bbf0
commit
a4eb46acc1
@@ -90,6 +90,11 @@ export function augmentObject<T extends object>(data: T): T {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const value = Reflect.get(target, key, receiver);
|
||||
|
||||
if (typeof value !== 'object' || value === null) return value;
|
||||
if (value instanceof RegExp) return value.toString();
|
||||
if ('toJSON' in value && typeof value.toJSON === 'function') return value.toJSON() as T;
|
||||
|
||||
const newValue = augment(value);
|
||||
if (newValue !== value) {
|
||||
Object.assign(newData, { [key]: newValue });
|
||||
|
||||
Reference in New Issue
Block a user