iggs-utils - v2.4.0
    Preparing search index...

    Function getPathKeys

    • Returns an array of a given object's keys paths (own and nested key names) in a reccursive manner, iterated in the same order that a normal loop would.

      Parameters

      Returns string[]

      const object={ str:"hello", nr:1, fn: (a:number,b:number)=> a+b, arr:[1,2,3], nestedObject:{ str:"world", nr:2, fn: (a:number,b:number)=> a+b, arr:[4.5], } };

      getPathKeys(object)

      // RETURNS: // [ 'str', // 'nr', // 'fn', // 'arr', // 'nestedObject', // 'nestedObject.str', // 'nestedObject.nr', // 'nestedObject.fn', // 'nestedObject.arr' ]


      @example ```ts
      const object={
      str:"hello",
      nestedObject:{
      str:"world",
      nr:2,
      fn: (a:number,b:number)=> a+b,
      arr:[4.5],
      }
      };

      getPathKeys(object,{omitFirstLevel:true})

      // RETURNS:
      // [ 'str',
      // 'nestedObject.str',
      // 'nestedObject.nr',
      // 'nestedObject.fn',
      // 'nestedObject.arr' ]

      @param obj object from which to derive the paths @param options options object @returns