Revert "fix: jq-web -> jq-wasm, includes jq version 1.8.1 (#2223)"
This reverts commit 0c6454e10cea224f48d263bd4c22fb2d83db714d.
This commit is contained in:
parent
aa9befce15
commit
f4ca59dcdc
6
package-lock.json
generated
6
package-lock.json
generated
@ -54,7 +54,6 @@
|
|||||||
"ieee754": "^1.2.1",
|
"ieee754": "^1.2.1",
|
||||||
"jimp": "^1.6.0",
|
"jimp": "^1.6.0",
|
||||||
"jq-web": "^0.5.1",
|
"jq-web": "^0.5.1",
|
||||||
"jq-wasm": "^1.1.0-jq-1.8.1",
|
|
||||||
"jquery": "3.7.1",
|
"jquery": "3.7.1",
|
||||||
"js-sha3": "^0.9.3",
|
"js-sha3": "^0.9.3",
|
||||||
"jsesc": "^3.1.0",
|
"jsesc": "^3.1.0",
|
||||||
@ -12164,11 +12163,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/jq-web/-/jq-web-0.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/jq-web/-/jq-web-0.5.1.tgz",
|
||||||
"integrity": "sha512-3Fa3E6g3U1O1j46ljy0EM10yRr4txzILga8J7bqOG8F89gZ6Lilz82WG9z6TItWpYEO0YGa4W8yFGj+NMM1xqQ==",
|
"integrity": "sha512-3Fa3E6g3U1O1j46ljy0EM10yRr4txzILga8J7bqOG8F89gZ6Lilz82WG9z6TItWpYEO0YGa4W8yFGj+NMM1xqQ==",
|
||||||
"license": "ISC"
|
"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": {
|
"node_modules/jquery": {
|
||||||
"version": "3.7.1",
|
"version": "3.7.1",
|
||||||
|
|||||||
@ -137,7 +137,6 @@
|
|||||||
"ieee754": "^1.2.1",
|
"ieee754": "^1.2.1",
|
||||||
"jimp": "^1.6.0",
|
"jimp": "^1.6.0",
|
||||||
"jq-web": "^0.5.1",
|
"jq-web": "^0.5.1",
|
||||||
"jq-wasm": "^1.1.0-jq-1.8.1",
|
|
||||||
"jquery": "3.7.1",
|
"jquery": "3.7.1",
|
||||||
"js-sha3": "^0.9.3",
|
"js-sha3": "^0.9.3",
|
||||||
"jsesc": "^3.1.0",
|
"jsesc": "^3.1.0",
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
import OperationError from "../errors/OperationError.mjs";
|
import OperationError from "../errors/OperationError.mjs";
|
||||||
import * as jq from "jq-wasm";
|
import jq from "jq-web";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* jq operation
|
* jq operation
|
||||||
@ -40,15 +40,16 @@ class Jq extends Operation {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
return (async () => {
|
|
||||||
const [query] = args;
|
const [query] = args;
|
||||||
|
let result;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await jq.json(input, query);
|
result = jq.json(input, query);
|
||||||
return JSON.stringify(result);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new OperationError(`Invalid jq expression: ${err.message}`);
|
throw new OperationError(`Invalid jq expression: ${err.message}`);
|
||||||
}
|
}
|
||||||
})();
|
|
||||||
|
return JSON.stringify(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user