@luolapeikko/ts-common
    Preparing search index...

    Class IterPredicate

    The IterPredicate class provides utility functions for creating predicate functions for Iterable properties.

    v1.1.3

    Index

    Methods

    Methods

    • Creates a predicate function that checks if a specific item is not present in an Iterable.

      Type Parameters

      • P
      • T = P

      Parameters

      • item: T

        The item to check for.

      Returns (currentItem: P) => boolean

      A predicate function.

      const values = ['a', 'b', 'c'] as const;
      values.filter(IterPredicate.notOneOf('a')); // ['b', 'c']

      v1.1.3

    • Creates a predicate function that checks if a specific item is present in an Iterable.

      Type Parameters

      • P
      • T

      Parameters

      • item: T

        The item to check for.

      Returns (currentItem: P) => boolean

      A predicate function.

      const values = ['a', 'b', 'c'] as const;
      values.filter(IterPredicate.oneOf('a')); // ['a']

      v1.1.3