mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): fixes n8n-local-rules/no-json-parse-json-stringify warnings (#4407)
* 🔨 fixes * 🔨 set rule to error
This commit is contained in:
@@ -2,6 +2,7 @@ import { ContainerOptions, create_container, EventContext, Message, ReceiverOpti
|
||||
|
||||
import { ITriggerFunctions } from 'n8n-core';
|
||||
import {
|
||||
deepCopy,
|
||||
IDataObject,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
@@ -172,20 +173,20 @@ export class AmqpTrigger implements INodeType {
|
||||
|
||||
if (options.jsonConvertByteArrayToString === true && data.body.content !== undefined) {
|
||||
// The buffer is not ready... Stringify and parse back to load it.
|
||||
const cont = JSON.stringify(data.body.content);
|
||||
data.body = String.fromCharCode.apply(null, JSON.parse(cont).data);
|
||||
const cont = deepCopy(data.body.content);
|
||||
data.body = String.fromCharCode.apply(null, cont.data);
|
||||
}
|
||||
|
||||
if (options.jsonConvertByteArrayToString === true && data.body.content !== undefined) {
|
||||
// The buffer is not ready... Stringify and parse back to load it.
|
||||
const cont = JSON.stringify(data.body.content);
|
||||
data.body = String.fromCharCode.apply(null, JSON.parse(cont).data);
|
||||
const cont = deepCopy(data.body.content);
|
||||
data.body = String.fromCharCode.apply(null, cont.data);
|
||||
}
|
||||
|
||||
if (options.jsonConvertByteArrayToString === true && data.body.content !== undefined) {
|
||||
// The buffer is not ready... Stringify and parse back to load it.
|
||||
const content = JSON.stringify(data.body.content);
|
||||
data.body = String.fromCharCode.apply(null, JSON.parse(content).data);
|
||||
const content = deepCopy(data.body.content);
|
||||
data.body = String.fromCharCode.apply(null, content.data);
|
||||
}
|
||||
|
||||
if (options.jsonParseBody === true) {
|
||||
|
||||
Reference in New Issue
Block a user