mirror of
https://github.com/fluencelabs/jsonpath
synced 2025-04-25 09:22:19 +00:00
Clean some warnings
* 'msg' was used before it was defined. * Missing semicolon.
This commit is contained in:
parent
9d78b6910c
commit
f98b8d7894
@ -1,6 +1,13 @@
|
|||||||
import * as jpw from "jsonpath-wasm";
|
import * as jpw from "jsonpath-wasm";
|
||||||
import * as jp from "jsonpath/jsonpath.js";
|
import * as jp from "jsonpath/jsonpath.js";
|
||||||
|
|
||||||
|
function msg(msg) {
|
||||||
|
console.log(msg);
|
||||||
|
let div = document.createElement("div");
|
||||||
|
div.innerText = msg;
|
||||||
|
document.body.appendChild(div);
|
||||||
|
}
|
||||||
|
|
||||||
function run(message, iter, cb) {
|
function run(message, iter, cb) {
|
||||||
return new Promise(function(resolve, _reject) {
|
return new Promise(function(resolve, _reject) {
|
||||||
let d = Date.now();
|
let d = Date.now();
|
||||||
@ -9,14 +16,7 @@ function run(message, iter, cb) {
|
|||||||
}
|
}
|
||||||
msg([message, Date.now() - d].join(", "));
|
msg([message, Date.now() - d].join(", "));
|
||||||
setTimeout(resolve, 0);
|
setTimeout(resolve, 0);
|
||||||
})
|
});
|
||||||
}
|
|
||||||
|
|
||||||
function msg(msg) {
|
|
||||||
console.log(msg);
|
|
||||||
let div = document.createElement("div");
|
|
||||||
div.innerText = msg;
|
|
||||||
document.body.appendChild(div);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let json = {
|
let json = {
|
||||||
@ -65,12 +65,12 @@ let iterCount = 2000;
|
|||||||
|
|
||||||
run('jsonpath', iterCount, function() { jp.query(json, path) })
|
run('jsonpath', iterCount, function() { jp.query(json, path) })
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return run('jsonpath-wasm- selector', iterCount, function() { selector(path) });
|
return run('jsonpath-wasm- selector', iterCount, function() { selector(path); });
|
||||||
})
|
})
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return run('jsonpath-wasm- compile', iterCount, function() { template(json) });
|
return run('jsonpath-wasm- compile', iterCount, function() { template(json); });
|
||||||
})
|
})
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return run('jsonpath-wasm- select', iterCount, function() { jpw.select(json, path) });
|
return run('jsonpath-wasm- select', iterCount, function() { jpw.select(json, path); });
|
||||||
})
|
})
|
||||||
.finally(function() {});
|
.finally(function() {});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user