Return the second or third element based on the boolean value of the first element

@param {[boolean, any, any]} params
@returns {any}
433462
function $cond(params) {
    if (
        Array.isArray(params) &&
        params.length === 3 &&
        typeof params[0] === 'boolean'
    ) {
        return params[0] ? params[1] : params[2];
    }
    throw new Error(
        '$cond expects an array of three elements of which the first must be a boolean'
    );
}
285604
function $and( first ){
        return first.next ? function( thing ){
            var fn = first;
            while ( fn ){

                if ( !fn( thing ) ){
                    return false;
                }
                fn = fn.next;
            }
            return true;
        } : first;
    }
332051
function(param) {
    if (!this.collection) {
      throw new Error('collection property not found');
    }

    param = _.extend({}, param);
        
    return find(this.collection, param);
  }
68022
def getElementsBy(self, cond: Callable[[Element], bool]) -> NodeList:
        """"""
        return getElementsBy(self, cond)
1028510
function checkForDuplicates (params) {
  for (var i = 0; i < params.length - 1; i++) {
    var outer = params[i];
    for (var j = i + 1; j < params.length; j++) {
      var inner = params[j];
      if (outer.name === inner.name && outer.in === inner.in) {
        throw ono.syntax('Validation failed. Found multiple %s parameters named "%s"', outer.in, outer.name);
      }
    }
  }
}
442597
function(a, b) {
            c = this;
            if (!b) {
                return c.options[a];
            } else {
                c._u(a, b);
            }
        }
1046253
function(value, element, param) {
			return this.optional(element) || this.getLength($.trim(value), element) >= param;
		}
362488
protected Boolean asBoolean(String name, Map<String, Value> params) {
        return coerceToBoolean(params.get(name));
    }
242725
function(a, b) {
                var as = a.specificity;
                var bs = b.specificity;

                if (as[0] != bs[0]) return bs[0] - as[0];
                if (as[1] != bs[1]) return bs[1] - as[1];
                if (as[2] != bs[2]) return bs[2] - as[2];
                return bs[3] - as[3];
            }
120379
function or() {
    var predicates = Array.prototype.slice.call(arguments, 0);
    if (!predicates.length) {
      throw new Error('empty list of arguments to or');
    }

    return function orCheck() {
      var values = Array.prototype.slice.call(arguments, 0);
      return predicates.some(function (predicate) {
        try {
          return check.fn(predicate) ?
            predicate.apply(null, values) : Boolean(predicate);
        } catch (err) {
          // treat exceptions as false
          return false;
        }
      });
    };
  }
461239
public static function ask($param1, $param2 = null, $param3 = null) {
        self::init();
        if(is_array($param1)) {
            return self::smartSelect($param1, $param2, $param3);
        } else {
            switch(substr($param1, 0, 1)) {
                case '>':
                case '/':
                    return self::smartQuery($param1, $param2);
                    break;
                case '?':
                    return self::smartSelect(substr($param1, 1), $param2, $param3);
                    break;
                default:
                    if(is_array($param3)) {
                        return self::smartUpdate($param1, $param2, $param3);
                    } else {
                        return self::smartInsert($param1, $param2);
                    }
            }
        }
    }
1374852
private static function parseInputToBool($params)
    {
        return is_array($params) ? array_map(function ($item) {
            return ((bool)$item);
        }, $params) : ((bool)$params);
    }
5749
function $rands(params) {
    if (
        Array.isArray(params) &&
        params.length === 2 &&
        Array.isArray(params[0]) &&
        typeof params[1] === 'number'
    ) {
        return Array(params[1])
            .fill()
            .map(() =>
                params[0].splice(
                    Math.floor(Math.random() * params[0].length),
                    1
                )
            )[0];
    }
    throw new Error(
        '$rands expects an array of two elements of which the first must be an array and the second be a number'
    );
}
193452
function (opts1 /*, …options*/) {
		var result = create(null);
		forEach.call(arguments, function (options) {
			if (!isValue$2(options)) { return; }
			process(Object(options), result);
		});
		return result;
	}
353622
function(value) {
            	var V = value.elements || value;

            	if (this.elements.length != V.length) 
            	    return this.map(function(v) { return v + value });
            	else
            	    return this.map(function(x, i) { return x + V[i - 1]; });
                }
1128763
function validateParams(fs, param2) {
  var err;

  if(!fs) {
    err = new Errors.EINVAL('No filesystem provided');
  } else if(!param2) {
    err = new Errors.EINVAL('Second argument must be specified');
  }

  return err;
}
141180
function () {
			
			var i, length, radioInput;
			
			for (i = 0, length = this.choicesList.length ; i < length ; i += 1) {
				
				radioInput = this.choicesList[i].node.firstChild;
				
				if (radioInput.checked) {
					
					// if "any" option checked
					if (this.radioAny && this.radioAny == radioInput) {
						
						return this.anyField.getValue() === '';
						
					} else {
						
						return false;
						
					}
				}
			}
			
			return true;
			
		}