query
On this page

ifEnable

lib.ifEnable

Docs pulled from | This Revision | about 1 hour ago


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;