lyg
2024-08-01 ce8cb9c851fa66c7c2902ceb57e369d3cecf1a28
src/parse-isbn-log.mjs
@@ -13,7 +13,6 @@
    // 解析日志文件
    const bookLogs = log.split('开始下载');
    for (const bookLog of bookLogs) {
      const book = {};
      const lines = bookLog.split('\n');
      // 遍历日志行
      for (const line of lines) {
@@ -22,9 +21,11 @@
        reg = /.* ISBN: (.*)$/g;
        group = reg.exec(line);
        if (group) {
          const book = {};
          const text = group[1];
          const obj = JSON.stringify(text);
          const obj = JSON.parse(text);
          Object.assign(book, obj);
          books.push(book);
          continue;
        }
      }