query
On this page

ifEnable

lib.ifEnable

Docs pulled from | This Revision | 10 minutes ago
Deprecated


of the second argument.


Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

ifEnable =
    cond: val:
    if cond then
      val
    else if builtins.isList val then
      [ ]
    else if builtins.isAttrs val then
      { }
    # else if builtins.isString val then ""
    else if val == true || val == false then
      false
    else
      null;