diff --git a/db.js b/db.js index 09a05cc..54cecfc 100644 --- a/db.js +++ b/db.js @@ -27,7 +27,8 @@ module.exports = function db (dir, keys, opts) { var c = db.views[name].since.value current += (Number.isInteger(c) ? c : -1) } - prog.current = ~~(current / n) + // we use BigInt to avoid overflow errors + prog.current = Number(~~(BigInt(current) / BigInt(n))) // if the progress bar is complete, move the starting point // up to the current position! if (prog.start <= 0) {