Skip to content

Commit 9254cfb

Browse files
committed
style(generators): unify export syntax
1 parent c76c702 commit 9254cfb

File tree

13 files changed

+27
-52
lines changed

13 files changed

+27
-52
lines changed

common/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ var util = require('util');
44
var yeoman = require('yeoman-generator');
55

66

7-
module.exports = Generator;
8-
9-
function Generator() {
7+
var Generator = module.exports = function Generator() {
108
yeoman.generators.Base.apply(this, arguments);
11-
}
9+
};
1210

1311
util.inherits(Generator, yeoman.generators.Base);
1412

constant/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ var ScriptBase = require('../script-base.js');
55
var angularUtils = require('../util.js');
66

77

8-
module.exports = Generator;
9-
10-
function Generator() {
8+
var Generator = module.exports = function Generator() {
119
ScriptBase.apply(this, arguments);
12-
}
10+
};
1311

1412
util.inherits(Generator, ScriptBase);
1513

controller/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ var util = require('util');
44
var ScriptBase = require('../script-base.js');
55

66

7-
module.exports = Generator;
8-
9-
function Generator() {
7+
var Generator = module.exports = function Generator() {
108
ScriptBase.apply(this, arguments);
119

1210
// if the controller name is suffixed with ctrl, remove the suffix
1311
// if the controller name is just "ctrl," don't append/remove "ctrl"
1412
if (this.name && this.name.toLowerCase() !== 'ctrl' && this.name.substr(-4).toLowerCase() === 'ctrl') {
1513
this.name = this.name.slice(0, -4);
1614
}
17-
}
15+
};
1816

1917
util.inherits(Generator, ScriptBase);
2018

directive/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ var ScriptBase = require('../script-base.js');
55
var angularUtils = require('../util.js');
66

77

8-
module.exports = Generator;
9-
10-
function Generator() {
8+
var Generator = module.exports = function Generator() {
119
ScriptBase.apply(this, arguments);
12-
}
10+
};
1311

1412
util.inherits(Generator, ScriptBase);
1513

factory/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ var ScriptBase = require('../script-base.js');
55
var angularUtils = require('../util.js');
66

77

8-
module.exports = Generator;
9-
10-
function Generator() {
8+
var Generator = module.exports = function Generator() {
119
ScriptBase.apply(this, arguments);
12-
}
10+
};
1311

1412
util.inherits(Generator, ScriptBase);
1513

filter/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ var ScriptBase = require('../script-base.js');
55
var angularUtils = require('../util.js');
66

77

8-
module.exports = Generator;
9-
10-
function Generator() {
8+
var Generator = module.exports = function Generator() {
119
ScriptBase.apply(this, arguments);
12-
}
10+
};
1311

1412
util.inherits(Generator, ScriptBase);
1513

main/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ var ScriptBase = require('../script-base.js');
55
var yeoman = require('yeoman-generator');
66

77

8-
module.exports = Generator;
9-
10-
function Generator() {
8+
var Generator = module.exports = function Generator() {
119
ScriptBase.apply(this, arguments);
12-
}
10+
};
1311

1412
util.inherits(Generator, ScriptBase);
1513

provider/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ var ScriptBase = require('../script-base.js');
55
var angularUtils = require('../util.js');
66

77

8-
module.exports = Generator;
9-
10-
function Generator() {
8+
var Generator = module.exports = function Generator() {
119
ScriptBase.apply(this, arguments);
12-
}
10+
};
1311

1412
util.inherits(Generator, ScriptBase);
1513

route/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ var ScriptBase = require('../script-base.js');
55
var angularUtils = require('../util.js');
66

77

8-
module.exports = Generator;
9-
10-
function Generator() {
8+
var Generator = module.exports = function Generator() {
119
ScriptBase.apply(this, arguments);
1210
this.hookFor('angular:controller');
1311
this.hookFor('angular:view');
14-
}
12+
};
13+
1514
util.inherits(Generator, ScriptBase);
1615

1716
Generator.prototype.rewriteAppJs = function () {

script-base.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ var path = require('path');
44
var yeoman = require('yeoman-generator');
55
var angularUtils = require('./util.js');
66

7-
module.exports = Generator;
8-
9-
function Generator() {
7+
var Generator = module.exports = function Generator() {
108
yeoman.generators.NamedBase.apply(this, arguments);
119

1210
try {
@@ -60,7 +58,7 @@ function Generator() {
6058
}
6159

6260
this.sourceRoot(path.join(__dirname, sourceRoot));
63-
}
61+
};
6462

6563
util.inherits(Generator, yeoman.generators.NamedBase);
6664

0 commit comments

Comments
 (0)