Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Lists/Paths/getPath

Index

Functions

Functions

getPath

  • getPath<V>(list: List<V>, path: ListPath, defaultValue?: any, separator?: string): V
  • This method reads a single value or multiple values (depending on the given $path) from the given list. You may use wildcards by specifying an astrix(*) as the replacement for a generic key, which will iterate over all, possible keys in the given list. You may also specify a subset of keys to return, by using braces like [key1,key2]

    Type parameters

    • V = any

    Parameters

    • list: List<V>

      The list to read the paths values from

    • path: ListPath

      The path to read in the $input array

    • Optional defaultValue: any

      The value which will be returned if the $path did not match anything.

    • Optional separator: string

      Default: "." Can be set to any string you want to use as separator of path parts.

    Returns V

Generated using TypeDoc