mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Replace value === (value | 0)
checks with Number.isInteger(value)
in the src/
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
c8b5ba277a
commit
8686baede5
4 changed files with 8 additions and 7 deletions
|
@ -450,7 +450,7 @@ class AnnotationBorderStyle {
|
|||
* @param {integer} width - The width
|
||||
*/
|
||||
setWidth(width) {
|
||||
if (width === (width | 0)) {
|
||||
if (Number.isInteger(width)) {
|
||||
this.width = width;
|
||||
}
|
||||
}
|
||||
|
@ -537,7 +537,7 @@ class AnnotationBorderStyle {
|
|||
* @param {integer} radius - The horizontal corner radius
|
||||
*/
|
||||
setHorizontalCornerRadius(radius) {
|
||||
if (radius === (radius | 0)) {
|
||||
if (Number.isInteger(radius)) {
|
||||
this.horizontalCornerRadius = radius;
|
||||
}
|
||||
}
|
||||
|
@ -550,7 +550,7 @@ class AnnotationBorderStyle {
|
|||
* @param {integer} radius - The vertical corner radius
|
||||
*/
|
||||
setVerticalCornerRadius(radius) {
|
||||
if (radius === (radius | 0)) {
|
||||
if (Number.isInteger(radius)) {
|
||||
this.verticalCornerRadius = radius;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue