(str)
| 25 | let currentChunkStartLine = 1; |
| 26 | |
| 27 | const newChunkId = (str) => { |
| 28 | const hash = hashCode(str); |
| 29 | let hashNum = '0'; |
| 30 | for (const chunk of chunks) { |
| 31 | const [prevHash, prevHashNum] = chunk.chunkId.split('_'); |
| 32 | if (hash === prevHash) { |
| 33 | hashNum = (parseInt(prevHashNum, 10) + 1).toString(); |
| 34 | } |
| 35 | } |
| 36 | return `${hash}_${hashNum}`; |
| 37 | }; |
| 38 | |
| 39 | const pushChunk = (endLine) => { |
| 40 | const chunkContent = currentChunkLines.join('\n'); |