mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Replace value === (value | 0)
checks with Number.isInteger(value)
in the web/
folder
Rather than doing what (at first) may seem like a fairly obscure comparison, using `Number.isInteger` will clearly indicate the intent of the code.
This commit is contained in:
parent
8686baede5
commit
30b7a0f093
3 changed files with 5 additions and 6 deletions
|
@ -159,7 +159,7 @@ class PDFViewer {
|
|||
* @param {number} val - The page number.
|
||||
*/
|
||||
set currentPageNumber(val) {
|
||||
if ((val | 0) !== val) { // Ensure that `val` is an integer.
|
||||
if (!Number.isInteger(val)) {
|
||||
throw new Error('Invalid page number.');
|
||||
}
|
||||
if (!this.pdfDocument) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue