From b1369c97f033b51f40db3d2f99fbff2bc9d1ec91 Mon Sep 17 00:00:00 2001 From: Roman Karwacik Date: Thu, 19 Mar 2026 13:28:30 +0100 Subject: [PATCH] feat: add Raw option for Jq operation --- src/core/operations/Jq.mjs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/core/operations/Jq.mjs b/src/core/operations/Jq.mjs index c1e02b34..63271805 100644 --- a/src/core/operations/Jq.mjs +++ b/src/core/operations/Jq.mjs @@ -30,7 +30,12 @@ class Jq extends Operation { name: "Query", type: "string", value: "" - } + }, + { + name: "Raw", + type: "boolean", + value: false + }, ]; } @@ -40,7 +45,7 @@ class Jq extends Operation { * @returns {string} */ run(input, args) { - const [query] = args; + const [query, raw] = args; let result; try { @@ -48,8 +53,11 @@ class Jq extends Operation { } catch (err) { throw new OperationError(`Invalid jq expression: ${err.message}`); } - - return JSON.stringify(result); + if (raw && typeof result === 'string') { + return result; + } else { + return JSON.stringify(result); + } } }