Function getFunctionKeyBySource

  • Search for a function within a module by its source code. Returns the key of the function.

    Type Parameters

    • T

    Parameters

    • module: T

      The module to search.

    • match: string | RegExp | ((func: UnknownFunction) => boolean)

      The string or regex to match against the function's source code.

    Returns Extract<keyof T, string> | undefined

    Useful for getting the prop name to inject into.