We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d9dacf6 commit 7b47d25Copy full SHA for 7b47d25
1 file changed
src/core/operations/Jq.mjs
@@ -30,7 +30,12 @@ class Jq extends Operation {
30
name: "Query",
31
type: "string",
32
value: ""
33
- }
+ },
34
+ {
35
+ name: "Raw",
36
+ type: "boolean",
37
+ value: false
38
39
];
40
}
41
@@ -40,16 +45,19 @@ class Jq extends Operation {
45
* @returns {string}
46
*/
42
47
run(input, args) {
43
- const [query] = args;
48
+ const [query, raw] = args;
44
49
let result;
50
51
try {
52
result = jq.json(input, query);
53
} catch (err) {
54
throw new OperationError(`Invalid jq expression: ${err.message}`);
55
-
- return JSON.stringify(result);
56
+ if (raw) {
57
+ return result;
58
+ } else {
59
+ return JSON.stringify(result);
60
+ }
61
62
63
0 commit comments