Skip to content

Commit cdf02df

Browse files
committed
fix: jq-web -> jq-wasm, includes jq verison 1.8.1
1 parent cd7dafd commit cdf02df

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
"highlight.js": "^11.11.1",
136136
"ieee754": "^1.2.1",
137137
"jimp": "^1.6.0",
138-
"jq-web": "^0.6.2",
138+
"jq-wasm": "^1.1.0-jq-1.8.1",
139139
"jquery": "3.7.1",
140140
"js-sha3": "^0.9.3",
141141
"jsesc": "^3.1.0",

src/core/operations/Jq.mjs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import Operation from "../Operation.mjs";
88
import OperationError from "../errors/OperationError.mjs";
9-
import jq from "jq-web";
9+
import * as jq from "jq-wasm";
1010

1111
/**
1212
* jq operation
@@ -40,16 +40,16 @@ class Jq extends Operation {
4040
* @returns {string}
4141
*/
4242
run(input, args) {
43-
const [query] = args;
44-
let result;
45-
46-
try {
47-
result = jq.json(input, query);
48-
} catch (err) {
49-
throw new OperationError(`Invalid jq expression: ${err.message}`);
50-
}
51-
52-
return JSON.stringify(result);
43+
return (async () => {
44+
const [query] = args;
45+
try {
46+
const result = await jq.json(input, query)
47+
console.log(result)
48+
return JSON.stringify(result);
49+
} catch (err) {
50+
throw new OperationError(`Invalid jq expression: ${err.message}`);
51+
}
52+
})();
5353
}
5454

5555
}

0 commit comments

Comments
 (0)