弃用lodash

This commit is contained in:
fofolee
2024-12-30 20:41:54 +08:00
parent 7a79d3a443
commit 1d3aa3c9ae
30 changed files with 597 additions and 152 deletions

View File

@@ -47,12 +47,12 @@ export default {
if (item === null) return "null";
if (typeof item === "undefined") return "undefined";
if (typeof item === "string")
return _.truncate(item, { length: maxSize.txt });
return window.lodashM.truncate(item, { length: maxSize.txt });
if (typeof item === "number") return item;
if (typeof item === "function")
return `f ${item.name ? item.name + "()" : "anonymous()"}`;
if (typeof item !== "object") return item.toString();
if (_.isBuffer(item)) {
if (window.lodashM.isBuffer(item)) {
var bufferString = `[Buffer ${item
.slice(0, maxSize.buff)
.toString("hex")