fix(nbd-client/readBlocks): BigInt handling for default generator

This commit is contained in:
Florent BEAUCHAMP
2023-06-07 09:58:11 +02:00
committed by Julien Fontanet
parent ea34516d73
commit 4e032e11b1
2 changed files with 4 additions and 2 deletions

View File

@@ -313,8 +313,8 @@ module.exports = class NbdClient {
const exportSize = this.#exportSize
const chunkSize = 2 * 1024 * 1024
indexGenerator = function* () {
const nbBlocks = Math.ceil(exportSize / chunkSize)
for (let index = 0; index < nbBlocks; index++) {
const nbBlocks = Math.ceil(Number(exportSize / BigInt(chunkSize)))
for (let index = 0; BigInt(index) < nbBlocks; index++) {
yield { index, size: chunkSize }
}
}

View File

@@ -27,4 +27,6 @@
<!--packages-start-->
- @vates/nbd-client patch
<!--packages-end-->