Options
All
  • Public
  • Public/Protected
  • All
Menu

Module propertyOf

Index

Functions Util

Util Functions

  • default(object: any): (path: any) => any
  • The opposite of propertys method creates a function that returns the value at a given path of object.

    since

    5.0.0

    example
    const array = [0, 1, 2]
    const object = { 'a': array, 'b': array, 'c': array }

    map(['a[2]', 'c[0]'], propertyOf(object))
    // => [2, 0]

    map([['a', '2'], ['c', '0']], propertyOf(object))
    // => [2, 0]

    Parameters

    • object: any

      The object to query.

    Returns (path: any) => any

    Returns the new accessor function.

      • (path: any): any
      • Parameters

        • path: any

        Returns any