Better type handling

pull/4717/head
Matt Visnovsky 7 months ago
parent efb1642e3c
commit 36dc94b8f2

@ -399,11 +399,12 @@ function intHash(str, length = 10) {
exports.intHash = intHash;
async function evaluateJsonQuery(data, jsonPath, jsonPathOperator, expectedValue) {
const expected = isNaN(expectedValue) ? expectedValue.toString() : parseFloat(expectedValue);
let response = isNaN(data) ? data.toString() : parseFloat(data);
let response;
try {
response = JSON.parse(response);
response = JSON.parse(data);
}
catch (_) {
catch (_a) {
response = typeof data === "number" || typeof data === "object" ? data : data.toString();
}
let jsonQueryExpression;
switch (jsonPathOperator) {

Loading…
Cancel
Save