code: function isInBooleanContext(node, parent) {
              return (
                  (BOOLEAN_NODE_TYPES.indexOf(parent.type) !== -1 &&
                      node === parent.test) ||
  
                  // !<bool>
                  (parent.type === "UnaryExpression" &&
                      parent.operator === "!")
              );
          }
docs: Check if a node is in a context where its value would be coerced to a boolean at runtime.
  
  @param {Object} node The node
  @param {Object} parent Its parent
  @returns {boolean} If it is in a boolean context