refactor: utils structure

This commit is contained in:
linyuchen 2024-03-18 11:10:53 +08:00
parent 4c6bd3df0b
commit 911841401a
2 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
function truncateString(obj: any, maxLength = 500) { export function truncateString(obj: any, maxLength = 500) {
if (obj !== null && typeof obj === 'object') { if (obj !== null && typeof obj === 'object') {
Object.keys(obj).forEach(key => { Object.keys(obj).forEach(key => {
if (typeof obj[key] === 'string') { if (typeof obj[key] === 'string') {

View File

@ -1,7 +1,7 @@
import {selfInfo} from "../data"; import {selfInfo} from "../data";
import fs from "fs"; import fs from "fs";
import path from "node:path"; import path from "node:path";
import {DATA_DIR} from "./index"; import {DATA_DIR, truncateString} from "./index";
import {getConfigUtil} from "../config"; import {getConfigUtil} from "../config";
export function log(...msg: any[]) { export function log(...msg: any[]) {