src/lib/methods/get.js
function resolveReferences(store, value, depth) {
  if (--depth < 0) {
    return value;
  }

  if (Array.isArray(value)) {
    const n = value.length;
    const v = new Array(n);
    let item;

    for (let i = n - 1; i >= 0; i--) {
      item = value[i];
      v[i] = resolveReferences(
        store,
        store._isRefValue(item) ? property.get(store._data, store._parseRefKey(item)) : item,
        depth
      );
    }

    value = v;
  } else if (isPlainObject(value)) {
    const v = {};
    let item;

    for (const prop in value) {
      item = value[prop];
      v[prop] = resolveReferences(
        store,
        store._isRefValue(item) ? property.get(store._data, store._parseRefKey(item)) : item,
        depth
      );
    }

    value = v;
  }

  return value;
}
function resolveReferences(store, value, depth) {
  if (--depth < 0) {
    return value;
  }

  if (Array.isArray(value)) {
    const n = value.length;
    const v = new Array(n);
    let item;

    for (let i = n - 1; i >= 0; i--) {
      item = value[i];
      v[i] = resolveReferences(
        store,
        store._isRefValue(item) ? property.get(store._data, store._parseRefKey(item)) : item,
        depth
      );
    }

    value = v;
  } else if (isPlainObject(value)) {
    const v = {};
    let item;

    for (const prop in value) {
      item = value[prop];
      v[prop] = resolveReferences(
        store,
        store._isRefValue(item) ? property.get(store._data, store._parseRefKey(item)) : item,
        depth
      );
    }

    value = v;
  }

  return value;
}
Resolve all references in 'value' up to max 'depth'
@param {DataStore} store
@param {Object} value
@param {Number} depth
@returns {Object}