Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

Functions

getByKey

  • getByKey(source: object, target: string, delimiter?: string): any
  • FindKey by key string

    can use dot notation for deep nested value

    eg:

    import NOM from 'nested-object-mutator'
    
    const source = {
     a: 1,
     b: {
       c: 2
     }
    }
    
    const result = NOM.getByKey(source, "a.b.c", ".")
    
    The result is `2`. return null if not exists.
    

    Parameters

    • source: object
    • target: string

      target key.

    • delimiter: string = "."

      default delimiter is .

    Returns any

    true if exist

Generated using TypeDoc