This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
const path = require('path');
/**
* 聊天日志 JSON 路径:环境变量 CHAT_LOG_PATH(绝对路径或相对项目根),未设置则为 <root>/chat_logs.json
*/
function resolveChatLogPath(rootDir) {
const raw = process.env.CHAT_LOG_PATH;
if (raw == null || !String(raw).trim()) {
return path.join(rootDir, 'chat_logs.json');
}
const p = String(raw).trim();
return path.isAbsolute(p) ? p : path.join(rootDir, p);
module.exports = { resolveChatLogPath };