Resolve a dependency.

The identifier of the dependency.

If true, throws an error if the dependency is not found.

The resolved dependency or undefined if the dependency is not necessary and not found, or throws an error if the dependency is necessary and not found.

A DependencyResolutionError if the dependency is not found and necessary.

  • Resolve a dependency.

    Type Parameters

    • T

    Parameters

    • identifier: string

      The identifier of the dependency.

    Returns T

    The resolved dependency.

    A DependencyResolutionError if the dependency is not found.

  • Resolve a dependency

    Type Parameters

    • T

    Parameters

    • identifier: string

      The identifier of the dependency.

    • necessary: false

      The dependency is not necessary.

    Returns T | undefined

    The resolved dependency or undefined if the dependency is not found.