utilitish - v0.0.10
    Preparing search index...

    Function assertValidSelector

    • Asserts that a selector parameter is valid, i.e., a function or a string.

      Type Parameters

      • T

        The type of the input items.

      • R

        The type of the selected value.

      Parameters

      • selector: any

        The selector to validate.

      • Optionalname: string = 'selector'

        The name to use in error messages.

      Returns asserts selector is Selector<T, R>

      If the selector is neither a function nor a string.

      Used internally by resolveSelector to provide clearer type safety and errors.