mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-03-17 16:03:08 +00:00
- Fix $() node reference triggering "Invalid $ usage" warning by adding ( and _ to regex lookahead - Fix helper function primitive returns triggering "Cannot return primitive values" error - Fix null values in diff engine causing Zod validation errors — null now deletes properties - Update property removal docs from undefined to null Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
599bc664d0
commit
65ab94deb2
@@ -1237,15 +1237,21 @@ export class WorkflowDiffEngine {
|
||||
private setNestedProperty(obj: any, path: string, value: any): void {
|
||||
const keys = path.split('.');
|
||||
let current = obj;
|
||||
|
||||
|
||||
for (let i = 0; i < keys.length - 1; i++) {
|
||||
const key = keys[i];
|
||||
if (!(key in current) || typeof current[key] !== 'object') {
|
||||
if (!(key in current) || typeof current[key] !== 'object' || current[key] === null) {
|
||||
if (value === null) return; // parent path doesn't exist, nothing to delete
|
||||
current[key] = {};
|
||||
}
|
||||
current = current[key];
|
||||
}
|
||||
|
||||
current[keys[keys.length - 1]] = value;
|
||||
|
||||
const finalKey = keys[keys.length - 1];
|
||||
if (value === null) {
|
||||
delete current[finalKey];
|
||||
} else {
|
||||
current[finalKey] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user