ts-data-forge
    Preparing search index...

    Function isNotBigint

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

      Type Narrowing Behavior:

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

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

      const values: unknown[] = [1n, 2, 3n];

      const nonBigints = values.filter(isNotBigint);

      assert.deepStrictEqual(nonBigints, [2]);