ts-data-forge
    Preparing search index...

    Function isNotNumber

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

      Type Narrowing Behavior:

      • Excludes number 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, number>

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

      const mixed: unknown[] = [1, '2', 3];

      const nonNumbers = mixed.filter(isNotNumber);

      assert.deepStrictEqual(nonNumbers, ['2']);