schmod / babel-plugin-angularjs-annotate

Add Angular 1.x dependency injection annotations to ES6 code
http://schmod.github.io/babel-plugin-angularjs-annotate
MIT License
241 stars 26 forks source link

feature: add nginject condition #61

Open coderaiser opened 1 year ago

coderaiser commented 1 year ago

Running code a couple times with:

run.$inject = ["$document", "$http", "$injector"];
export default function run($document, $http, $injector) {
  'ngInject';
}

produces:

run.$inject = ["$document", "$http", "$injector"];
run.$inject = ["$document", "$http", "$injector"];
export default function run($document, $http, $injector) {
  'ngInject';
}

Related to https://github.com/coderaiser/putout/issues/128