ts-data-forge
    Preparing search index...

    Function isNotSymbol

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

      Type Narrowing Behavior:

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

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

      const id = Symbol('id');
      const tokens: unknown[] = [id, 'shared'];

      const nonSymbols = tokens.filter(isNotSymbol);

      assert.deepStrictEqual(nonSymbols, ['shared']);