ts-data-forge
    Preparing search index...

    Function isNotBoolean

    • Type guard that checks if a value is not a boolean.

      Type Narrowing Behavior:

      • Excludes boolean from the input type when true
      • Preserves all other types in the union

      Type Parameters

      • T

        The type of the input value

      Parameters

      • u: T

        The value to check

      Returns u is RelaxedExclude<T, boolean>

      true if u is not a boolean, false otherwise. When true, TypeScript excludes boolean from the type.

      const flags: unknown[] = [true, 'no', false];

      const nonBooleans = flags.filter(isNotBoolean);

      assert.deepStrictEqual(nonBooleans, ['no']);