This commit is contained in:
zw199166
2026-01-22 14:34:38 +08:00
parent 6ee8ce42ed
commit 1f3a3ca8bb
234 changed files with 5534 additions and 2395 deletions

View File

@@ -1,6 +1,25 @@
"use strict";
require("../common/vendor.js");
const common_vendor = require("../common/vendor.js");
require("../request/http.js");
function isValidJSON(jsonString) {
if (typeof jsonString !== "string") {
common_vendor.index.__f__("warn", "at utils/util.js:49", "输入必须是字符串类型");
return false;
}
jsonString = jsonString.trim();
if (jsonString === "") {
return false;
}
try {
const parsed = JSON.parse(jsonString);
if (typeof parsed !== "object" || parsed === null)
return false;
return true;
} catch (error) {
common_vendor.index.__f__("log", "at utils/util.js:70", "JSON 格式错误:", error.message);
return false;
}
}
function accDiv(arg1, arg2) {
var t1 = 0, t2 = 0, r1, r2;
try {
@@ -131,5 +150,6 @@ exports.getLocaleMonthDayHourMinte = getLocaleMonthDayHourMinte;
exports.getLocaleTime = getLocaleTime;
exports.getRateStr = getRateStr;
exports.getRateUpOrDown = getRateUpOrDown;
exports.isValidJSON = isValidJSON;
exports.replaceAnswerLabel = replaceAnswerLabel;
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/util.js.map