<commit_before>function Convert(FactoryModel) {
  var FactoryConstructor = FactoryModel.src;

  if (!angular.isFunction(FactoryConstructor)) {
    throw new Error('Wrong factory source definition. Expect function (constructor)');
  }

  var FactoryFunction = function($injector, ...dependencies) {
    var injector = new Injector($injector);

    return new FactoryConstructor(...[injector].concat(dependencies));
  };

  var deps = FactoryModel.dependencies;
  return [...deps, FactoryFunction];
}

export default function(factory) {
  var FactoryModel = factory.model;

  var moduleName = FactoryModel.module;

  if (!moduleName) {
    throw new Error(`Application name is not described for factory: "${FactoryModel.name}"`);
  }

  var di = Convert(FactoryModel);

  angular.module(moduleName)
      .factory(FactoryModel.name, di);
};<commit_msg>[fix] Factory converter - Injector<commit_after>

function Convert(FactoryModel) {
  var FactoryConstructor = FactoryModel.src;

  if (!angular.isFunction(FactoryConstructor)) {
    throw new Error('Wrong factory source definition. Expect function (constructor)');
  }

  var FactoryFunction = function(...dependencies) {
    return new FactoryConstructor(dependencies);
  };

  var deps = FactoryModel.dependencies;
  return [...deps, FactoryFunction];
}

export default function(factory) {
  var FactoryModel = factory.model;

  var moduleName = FactoryModel.module;

  if (!moduleName) {
    throw new Error(`Application name is not described for factory: "${FactoryModel.name}"`);
  }

  var di = Convert(FactoryModel);

  angular.module(moduleName)
      .factory(FactoryModel.name, di);
};
{'fraction_non_alphanumeric': 0.11914893617021277, 'fraction_numerical': 0.0, 'mean_word_length': 4.505016722408027, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5077978', 'n_tokens_mistral': 461, 'n_tokens_neox': 441, 'n_words': 119}