Options
All
  • Public
  • Public/Protected
  • All
Menu

Module methodOf

Index

References

Functions Util

References

Renames and re-exports __type

Util Functions

  • methodOf(object: any, ...args: any[]): any
  • The opposite of method this method creates a function that invokes the method at a given path of object. Any additional arguments are provided to the invoked method.

    since

    5.12.0

    example
    const array = times(3, i => () => i)
    const object = { 'a': array, 'b': array, 'c': array }

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

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

    Parameters

    • object: any

      The object to query.

    • Rest ...args: any[]

      The arguments to invoke the method with.

    Returns any

    Returns the new invoker function.