Function deepHasProperty

  • check if object has a property

    Parameters

    • object: any
    • property: string

      a property in the object. Can be a path like 'a.b.c'

    Returns void

    deepHasProperty([{a: {b: {c: 1}}}], '[0].a.b.c');
    
  • check if object has a property with a specific value

    Parameters

    • object: any
    • property: string

      a property in the object. Can be a path like 'a.b.c'

    • value: any

    Returns void

    deepHasProperty([{a: {b: {c: 1}}}], '[0].a.b.c', 1);