Skip to content

Commit

Permalink
fix(接口测试): 修复jsonpath精度提取问题
Browse files Browse the repository at this point in the history
--bug=1025961 --user=王孝刚 【接口测试】jsonpath提取的值精度缺失(数组)
https://www.tapd.cn/55049933/s/1369481
  • Loading branch information
wxg0103 authored and fit2-zhao committed May 6, 2023
1 parent 9bc880e commit 3dabfc8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default {
open(objStr) {
this.data = {};
try {
let stringedJSON = objStr.replace(/:\s*(?!.*\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}\+\d{2}:\d{2})\s([-+Ee0-9.]+)/g, ': "$1"');
let stringedJSON = objStr.replace(/(?<=[:\[,])\s*(-?\d+(\.\d+)?)(?=\s*([,\]}]))/g, ': "$1"');
let param;
let JSONBig = require('json-bigint')({"storeAsString": true});
// 解决精度丢失问题
Expand Down

0 comments on commit 3dabfc8

Please sign in to comment.