Skip to content

Commit fc4392f

Browse files
fix: replace parseInt with Number.parseInt for better ES2015 compliance
1 parent cd129fb commit fc4392f

File tree

2 files changed

+1604
-1571
lines changed

2 files changed

+1604
-1571
lines changed

controllers/tasks.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,11 @@ const updateTaskStatus = async (req, res, next) => {
372372
const isCurrentTaskStatusBlock = task.taskData.status === TASK_STATUS.BLOCKED;
373373
const isNewTaskStatusInProgress = status === TASK_STATUS.IN_PROGRESS;
374374
const isNewTaskStatusBlock = status === TASK_STATUS.BLOCKED;
375-
const isCurrProgress100 = parseInt(task.taskData.percentCompleted || 0) === 100;
376-
const isCurrProgress0 = parseInt(task.taskData.percentCompleted || 0) === 0;
377-
const isNewProgress100 = !!req.body.percentCompleted && parseInt(req.body.percentCompleted) === 100;
378-
const isNewProgress0 = !!req.body.percentCompleted !== undefined && parseInt(req.body.percentCompleted) === 0;
375+
const isCurrProgress100 = Number.parseInt(task.taskData.percentCompleted || 0) === 100;
376+
const isCurrProgress0 = Number.parseInt(task.taskData.percentCompleted || 0) === 0;
377+
const isNewProgress100 = !!req.body.percentCompleted && Number.parseInt(req.body.percentCompleted) === 100;
378+
const isNewProgress0 =
379+
req.body.percentCompleted !== undefined && Number.parseInt(req.body.percentCompleted) === 0;
379380

380381
if (
381382
!isCurrProgress100 &&

0 commit comments

Comments
 (0)