fix: jq-web -> jq-wasm, includes jq verison 1.8.1

This commit is contained in:
William Floyd 2026-03-05 10:44:52 -06:00
parent cd7dafdf53
commit 4126935c9c
No known key found for this signature in database
GPG Key ID: B3EEEDD81893CAF9
3 changed files with 17 additions and 18 deletions

12
package-lock.json generated
View File

@ -52,7 +52,7 @@
"highlight.js": "^11.11.1",
"ieee754": "^1.2.1",
"jimp": "^1.6.0",
"jq-web": "^0.6.2",
"jq-wasm": "^1.1.0-jq-1.8.1",
"jquery": "3.7.1",
"js-sha3": "^0.9.3",
"jsesc": "^3.1.0",
@ -12060,11 +12060,11 @@
"integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==",
"license": "BSD-3-Clause"
},
"node_modules/jq-web": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/jq-web/-/jq-web-0.6.2.tgz",
"integrity": "sha512-+7XvjBYwTx4vP5PYkf6Q6orubO/v+UgMU6By1GritrmShr9QpT3UKa4ANzXWQfhdqtBnQYXsm7ZNbdIHT6tYpQ==",
"license": "ISC"
"node_modules/jq-wasm": {
"version": "1.1.0-jq-1.8.1",
"resolved": "https://registry.npmjs.org/jq-wasm/-/jq-wasm-1.1.0-jq-1.8.1.tgz",
"integrity": "sha512-lWfu34lpDFIygOYcL5TzxhZIApDR9iR5XywcVoyUAZ6jlQrj8HKHOKeCcHgUm2dE9RVdbP3eqNAKGLuj+k4seQ==",
"license": "MIT"
},
"node_modules/jquery": {
"version": "3.7.1",

View File

@ -135,7 +135,7 @@
"highlight.js": "^11.11.1",
"ieee754": "^1.2.1",
"jimp": "^1.6.0",
"jq-web": "^0.6.2",
"jq-wasm": "^1.1.0-jq-1.8.1",
"jquery": "3.7.1",
"js-sha3": "^0.9.3",
"jsesc": "^3.1.0",

View File

@ -6,7 +6,7 @@
import Operation from "../Operation.mjs";
import OperationError from "../errors/OperationError.mjs";
import jq from "jq-web";
import * as jq from "jq-wasm";
/**
* jq operation
@ -40,16 +40,15 @@ class Jq extends Operation {
* @returns {string}
*/
run(input, args) {
const [query] = args;
let result;
try {
result = jq.json(input, query);
} catch (err) {
throw new OperationError(`Invalid jq expression: ${err.message}`);
}
return JSON.stringify(result);
return (async () => {
const [query] = args;
try {
const result = await jq.json(input, query);
return JSON.stringify(result);
} catch (err) {
throw new OperationError(`Invalid jq expression: ${err.message}`);
}
})();
}
}