Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Reflector

Helper class providing Nest reflection capabilities. Helper class providing Nest reflection capabilities.

see

Reflection

publicapi
see

Reflection

publicapi

Hierarchy

  • Reflector

Index

Methods

get

  • get(metadataKey: any, target: any): any
  • Retrieve metadata for a specified key for a specified target.

    example

    const roles = this.reflector.get<string[]>('roles', context.getHandler());

    Parameters

    • metadataKey: any

      lookup key for metadata to retrieve

    • target: any

      context (decorated object) to retrieve metadata from

    Returns any

getAll

  • getAll(metadataKey: any, targets: any): any
  • Retrieve metadata for a specified key for a specified set of targets.

    Parameters

    • metadataKey: any

      lookup key for metadata to retrieve

    • targets: any

      context (decorated objects) to retrieve metadata from

    Returns any

getAllAndMerge

  • getAllAndMerge(metadataKey: any, targets: any): any
  • Retrieve metadata for a specified key for a specified set of targets and merge results.

    Parameters

    • metadataKey: any

      lookup key for metadata to retrieve

    • targets: any

      context (decorated objects) to retrieve metadata from

    Returns any

getAllAndOverride

  • getAllAndOverride(metadataKey: any, targets: any): any
  • Retrieve metadata for a specified key for a specified set of targets and return a first not undefined value.

    Parameters

    • metadataKey: any

      lookup key for metadata to retrieve

    • targets: any

      context (decorated objects) to retrieve metadata from

    Returns any

Generated using TypeDoc