How to use the ramda-adjunct.isTrue function in ramda-adjunct

To help you get started, we’ve selected a few ramda-adjunct examples, based on popular ways it is used in public projects.

github DFEAGILEDEVOPS / MTC / admin / services / pupil-register.service.js View on Github external
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
  },
github DFEAGILEDEVOPS / MTC / admin / services / pupil-register.service.js View on Github external
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` +
github Undistraction / cssapi / src / utils / baseline.js View on Github external
export const linesForFontsize = (
  minLeading,
  allowHalfLines,
  baselineHeight,
  fontSize
) =>
  isTrue(allowHalfLines)
    ? divideBy2(
        wholeLinesForFontSize(minLeading, fontSize, divideBy2(baselineHeight))
      )
    : wholeLinesForFontSize(minLeading, fontSize, baselineHeight)