PDF.js version: 3.5.141

These two properties should be marked as not mandatory as they are initialized if not present
} else {
            const lastId = yArray[numPages - 1];
            if (lastId > currentPageNumber) {
              return lastId - currentPageNumber + 1;
            }
          }
          break;
        }
        break;
      }
      case ScrollMode.HORIZONTAL: {
        break;
      }
      case ScrollMode.PAGE:
      case ScrollMode.VERTICAL: {
        if (this._spreadMode === SpreadMode.NONE) {
          break; 
        }
        const parity = this._spreadMode - 1;
        if (previous && currentPageNumber % 2 !== parity) {
          break; 
        } else if (!previous && currentPageNumber % 2 === parity) {
          break; 
        }
        const { views } = this._getVisiblePages(),
          expectedId = previous ? currentPageNumber - 1 : currentPageNumber + 1;
        for (const { id, percent, widthPercent } of views) {
          if (id !== expectedId) {
            continue;
          }