Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (isPositive(attendanceId)) {
status = 'Not taking the Check'
} else if (isTrue(restartAvailable)) {
status = 'Restart'
} else if ((isNil(currentCheckId) && isNil(checkStatusCode)) ||
(isPositive(currentCheckId) && isNew(checkStatusCode) &&
(isNil(pinExpiresAt) || isExpired(pinExpiresAt)))) {
status = 'Not started'
} else if (isPositive(currentCheckId) && isNew(checkStatusCode)) {
status = 'PIN generated'
} else if (isPositive(currentCheckId) && isCollected(checkStatusCode) && isFalse(checkReceived)) {
status = 'Logged in'
if (isNotReceived(pupilLoginDate, notReceivedExpiryInMinutes, moment.utc())) {
status = 'Incomplete'
}
} else if (isTrue(checkReceived) && isTrue(checkComplete) && isComplete(checkStatusCode) && isTrue(pupilCheckComplete)) {
status = 'Complete'
} else {
logger.error(`getProcessStatusV2(): ERROR: Unable to determine status for pupil [${pupilId}] arg was: \n` +
JSON.stringify(arg, ' ', 4))
}
return status
},
currentCheckId,
notReceivedExpiryInMinutes,
pinExpiresAt,
pupilCheckComplete,
pupilId,
pupilLoginDate,
restartAvailable
} = arg
if (pinExpiresAt && !moment.isMoment(pinExpiresAt)) {
throw new Error('pinExpiresAt must be null or a Moment.moment datetime')
}
if (isPositive(attendanceId)) {
status = 'Not taking the Check'
} else if (isTrue(restartAvailable)) {
status = 'Restart'
} else if ((isNil(currentCheckId) && isNil(checkStatusCode)) ||
(isPositive(currentCheckId) && isNew(checkStatusCode) &&
(isNil(pinExpiresAt) || isExpired(pinExpiresAt)))) {
status = 'Not started'
} else if (isPositive(currentCheckId) && isNew(checkStatusCode)) {
status = 'PIN generated'
} else if (isPositive(currentCheckId) && isCollected(checkStatusCode) && isFalse(checkReceived)) {
status = 'Logged in'
if (isNotReceived(pupilLoginDate, notReceivedExpiryInMinutes, moment.utc())) {
status = 'Incomplete'
}
} else if (isTrue(checkReceived) && isTrue(checkComplete) && isComplete(checkStatusCode) && isTrue(pupilCheckComplete)) {
status = 'Complete'
} else {
logger.error(`getProcessStatusV2(): ERROR: Unable to determine status for pupil [${pupilId}] arg was: \n` +
export const linesForFontsize = (
minLeading,
allowHalfLines,
baselineHeight,
fontSize
) =>
isTrue(allowHalfLines)
? divideBy2(
wholeLinesForFontSize(minLeading, fontSize, divideBy2(baselineHeight))
)
: wholeLinesForFontSize(minLeading, fontSize, baselineHeight)