Function getRefs

Gets a flat list of all references of an isMany value (Array, Object, Set, Map etc) & returns them as an array.

  • Parameters

    • value: object | any[]

      The Object or Array to get all references

    • Optionaloptions: GetRefsOptions

      IgetRefsOptions extends IloopOptions, to control the behavior of this function (which keys to consider etc), so you can pass any of these options to affect the comparison.

      You can also use :

      depth: If depth is true, all references in nested Objects/Arrays are retrieved. If number, then it is the max depth to consider. If false or 0, only top-level references are considered. Default is true.

    • refsSet: Set<any> = ...

      The Set to which all references are pushed. If not passed, a new Set is created and returned.

    • _currentDepth: number = 0

    Returns Set<any>

    Array of all references in the Object or Array