lyg
2024-07-23 1682ba16b10a521e5fd943922f8379ebb5cd2804
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.parse(text);
          Object.assign(book, obj);
          books.push(book);
          continue;
        }
      }