@bytebury/sauce - v1.4.0
    Preparing search index...

    Function bool

    • Converts the given parameter to a boolean.

      This is the same as doing Boolean(value) however, if the value is a string containing only whitespace, this function will consider that an empty string, and therefore return false.

      Type Parameters

      • T

      Parameters

      Returns boolean

      bool("false"); // true
      bool("true"); // true
      bool(""); // false
      bool(" "); // false
      bool(false); // false
      bool("null"); // true
      bool({}); // true
      bool("Hello World"); // true
      bool(wrap(null)); // false
      bool(wrap('')); // true