@yookue/ts-lang-utils
    Preparing search index...

    Function isTrue

    • Returns whether the given value can be converted to true

      Parameters

      • Optionalvalue: null | string | number | boolean | (() => boolean)

        the source value to check

      Returns boolean

      whether the given value can be converted to true

      David Hsing

      isTrue(true);    // true
      isTrue(1); // true
      isTrue('true'); // true
      isTrue('yes'); // true
      isTrue('foobar'); // false
      isTrue(() => true); // true