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:
Jonas Jenwald 2017-09-03 13:08:50 +02:00
parent 8686baede5
commit 30b7a0f093
3 changed files with 5 additions and 6 deletions

View file

@ -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) {