mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(HTML Node): Escape data path value in JSON Property (#8441)
This commit is contained in:
@@ -326,3 +326,20 @@ export function preparePairedItemDataArray(
|
||||
if (Array.isArray(pairedItem)) return pairedItem;
|
||||
return [pairedItem];
|
||||
}
|
||||
|
||||
export const sanitazeDataPathKey = (item: IDataObject, key: string) => {
|
||||
if (item[key] !== undefined) {
|
||||
return key;
|
||||
}
|
||||
|
||||
if (
|
||||
(key.startsWith("['") && key.endsWith("']")) ||
|
||||
(key.startsWith('["') && key.endsWith('"]'))
|
||||
) {
|
||||
key = key.slice(2, -2);
|
||||
if (item[key] !== undefined) {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
return key;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user