code: function collectDependencies(dependencies, model, models) {
    if (!model || dependencies.has(model.modelClass)) {
      return;
    }
    dependencies.add(model.modelClass);
    if (model.modelDependencies) {
      model.modelDependencies.forEach((dep) =>
        collectDependencies(dependencies, dep, models)
      );
    }
  }
docs: Collects on the given dependencies set all dependencies of the given model