Skip to content

Commit f7d799a

Browse files
committed
rebeautify without spacing after keyword
1 parent e68108a commit f7d799a

File tree

124 files changed

+1426
-1432
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+1426
-1432
lines changed

lib/AbstractPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ AbstractPlugin.create = function(plugins) {
1616
};
1717

1818
AbstractPlugin.prototype.apply = function(object) {
19-
for (var name in this._plugins) {
19+
for(var name in this._plugins) {
2020
object.plugin(name, this._plugins[name]);
2121
}
2222
};

lib/AmdMainTemplatePlugin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ AmdMainTemplatePlugin.prototype.apply = function(compilation) {
2020
var externalsArguments = externals.map(function(m) {
2121
return "__WEBPACK_EXTERNAL_MODULE_" + m.id + "__";
2222
}).join(", ");
23-
if (this.name) {
23+
if(this.name) {
2424
var name = mainTemplate.applyPluginsWaterfall("asset-path", this.name, {
2525
hash: hash,
2626
chunk: chunk
2727
});
2828
return new ConcatSource("define(" + JSON.stringify(name) + ", " + externalsDepsArray + ", function(" + externalsArguments + ") { return ", source, "});");
29-
} else if (externalsArguments) {
29+
} else if(externalsArguments) {
3030
return new ConcatSource("define(" + externalsDepsArray + ", function(" + externalsArguments + ") { return ", source, "});");
3131
} else {
3232
return new ConcatSource("define(function() { return ", source, "});");
3333
}
3434
}.bind(this));
3535
mainTemplate.plugin("global-hash-paths", function(paths) {
36-
if (this.name) paths.push(this.name);
36+
if(this.name) paths.push(this.name);
3737
return paths;
3838
}.bind(this));
3939
mainTemplate.plugin("hash", function(hash) {

lib/ArrayMap.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ function ArrayMap() {
99
module.exports = ArrayMap;
1010

1111
ArrayMap.prototype.get = function(key) {
12-
for (var i = 0; i < this.keys.length; i++) {
13-
if (this.keys[i] === key) {
12+
for(var i = 0; i < this.keys.length; i++) {
13+
if(this.keys[i] === key) {
1414
return this.values[i];
1515
}
1616
}
1717
return;
1818
};
1919

2020
ArrayMap.prototype.set = function(key, value) {
21-
for (var i = 0; i < this.keys.length; i++) {
22-
if (this.keys[i] === key) {
21+
for(var i = 0; i < this.keys.length; i++) {
22+
if(this.keys[i] === key) {
2323
this.values[i] = value;
2424
return this;
2525
}
@@ -30,8 +30,8 @@ ArrayMap.prototype.set = function(key, value) {
3030
};
3131

3232
ArrayMap.prototype.remove = function(key) {
33-
for (var i = 0; i < this.keys.length; i++) {
34-
if (this.keys[i] === key) {
33+
for(var i = 0; i < this.keys.length; i++) {
34+
if(this.keys[i] === key) {
3535
this.keys.splice(i, 1);
3636
this.values.splice(i, 1);
3737
return true;
@@ -42,7 +42,7 @@ ArrayMap.prototype.remove = function(key) {
4242

4343
ArrayMap.prototype.clone = function() {
4444
var newMap = new ArrayMap();
45-
for (var i = 0; i < this.keys.length; i++) {
45+
for(var i = 0; i < this.keys.length; i++) {
4646
newMap.keys.push(this.keys[i]);
4747
newMap.values.push(this.values[i]);
4848
}

lib/AutomaticPrefetchPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ AutomaticPrefetchPlugin.prototype.apply = function(compiler) {
2727
callback();
2828
});
2929
compiler.plugin("make", function(compilation, callback) {
30-
if (!lastModules) return callback();
30+
if(!lastModules) return callback();
3131
async.forEach(lastModules, function(m, callback) {
3232
compilation.prefetch(m.context || compiler.context, new PrefetchDependency(m.request), callback);
3333
}, callback);

lib/BannerPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var ConcatSource = require("webpack-core/lib/ConcatSource");
66
var ModuleFilenameHelpers = require("./ModuleFilenameHelpers");
77

88
function wrapComment(str) {
9-
if (str.indexOf("\n") < 0) return "/*! " + str + " */";
9+
if(str.indexOf("\n") < 0) return "/*! " + str + " */";
1010
return "/*!\n * " + str.split("\n").join("\n * ") + "\n */";
1111
}
1212

@@ -23,7 +23,7 @@ BannerPlugin.prototype.apply = function(compiler) {
2323
compiler.plugin("compilation", function(compilation) {
2424
compilation.plugin("optimize-chunk-assets", function(chunks, callback) {
2525
chunks.forEach(function(chunk) {
26-
if (options.entryOnly && !chunk.initial) return;
26+
if(options.entryOnly && !chunk.initial) return;
2727
chunk.files.filter(ModuleFilenameHelpers.matchObject.bind(undefined, options)).forEach(function(file) {
2828
compilation.assets[file] = new ConcatSource(banner, "\n", compilation.assets[file]);
2929
});

lib/BasicEvaluatedExpression.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,27 @@ BasicEvaluatedExpression.prototype.isWrapped = function() {
3838
return Object.prototype.hasOwnProperty.call(this, "prefix") || Object.prototype.hasOwnProperty.call(this, "postfix");
3939
};
4040
BasicEvaluatedExpression.prototype.asBool = function() {
41-
if (this.isBoolean()) return this.bool;
42-
else if (this.isNull()) return false;
43-
else if (this.isString()) return !!this.string;
44-
else if (this.isNumber()) return !!this.number;
45-
else if (this.isRegExp()) return true;
46-
else if (this.isArray()) return true;
47-
else if (this.isConstArray()) return true;
48-
else if (this.isWrapped()) return this.prefix && this.prefix.asBool() || this.postfix && this.postfix.asBool() ? true : undefined;
41+
if(this.isBoolean()) return this.bool;
42+
else if(this.isNull()) return false;
43+
else if(this.isString()) return !!this.string;
44+
else if(this.isNumber()) return !!this.number;
45+
else if(this.isRegExp()) return true;
46+
else if(this.isArray()) return true;
47+
else if(this.isConstArray()) return true;
48+
else if(this.isWrapped()) return this.prefix && this.prefix.asBool() || this.postfix && this.postfix.asBool() ? true : undefined;
4949
return undefined;
5050
};
5151
BasicEvaluatedExpression.prototype.set = function(value) {
52-
if (typeof value === "string") return this.setString(value);
53-
if (typeof value === "number") return this.setNumber(value);
54-
if (typeof value === "boolean") return this.setBoolean(value);
55-
if (value === null) return this.setNull();
56-
if (value instanceof RegExp) return this.setRegExp(value);
57-
if (Array.isArray(value)) return this.setArray(value);
52+
if(typeof value === "string") return this.setString(value);
53+
if(typeof value === "number") return this.setNumber(value);
54+
if(typeof value === "boolean") return this.setBoolean(value);
55+
if(value === null) return this.setNull();
56+
if(value instanceof RegExp) return this.setRegExp(value);
57+
if(Array.isArray(value)) return this.setArray(value);
5858
return this;
5959
};
6060
BasicEvaluatedExpression.prototype.setString = function(str) {
61-
if (str === null)
61+
if(str === null)
6262
delete this.string;
6363
else
6464
this.string = str;
@@ -69,28 +69,28 @@ BasicEvaluatedExpression.prototype.setNull = function() {
6969
return this;
7070
};
7171
BasicEvaluatedExpression.prototype.setNumber = function(num) {
72-
if (num === null)
72+
if(num === null)
7373
delete this.number;
7474
else
7575
this.number = num;
7676
return this;
7777
};
7878
BasicEvaluatedExpression.prototype.setBoolean = function(bool) {
79-
if (bool === null)
79+
if(bool === null)
8080
delete this.bool;
8181
else
8282
this.bool = bool;
8383
return this;
8484
};
8585
BasicEvaluatedExpression.prototype.setRegExp = function(regExp) {
86-
if (regExp === null)
86+
if(regExp === null)
8787
delete this.regExp;
8888
else
8989
this.regExp = regExp;
9090
return this;
9191
};
9292
BasicEvaluatedExpression.prototype.setIdentifier = function(identifier) {
93-
if (identifier === null)
93+
if(identifier === null)
9494
delete this.identifier;
9595
else
9696
this.identifier = identifier;
@@ -107,28 +107,28 @@ BasicEvaluatedExpression.prototype.unsetWrapped = function() {
107107
return this;
108108
};
109109
BasicEvaluatedExpression.prototype.setOptions = function(options) {
110-
if (options === null)
110+
if(options === null)
111111
delete this.options;
112112
else
113113
this.options = options;
114114
return this;
115115
};
116116
BasicEvaluatedExpression.prototype.setItems = function(items) {
117-
if (items === null)
117+
if(items === null)
118118
delete this.items;
119119
else
120120
this.items = items;
121121
return this;
122122
};
123123
BasicEvaluatedExpression.prototype.setArray = function(array) {
124-
if (array === null)
124+
if(array === null)
125125
delete this.array;
126126
else
127127
this.array = array;
128128
return this;
129129
};
130130
BasicEvaluatedExpression.prototype.addOptions = function(options) {
131-
if (!this.options) this.options = [];
131+
if(!this.options) this.options = [];
132132
options.forEach(function(item) {
133133
this.options.push(item);
134134
}, this);

lib/CachePlugin.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function CachePlugin(cache) {
1010
module.exports = CachePlugin;
1111

1212
CachePlugin.prototype.apply = function(compiler) {
13-
if (Array.isArray(compiler.compilers)) {
13+
if(Array.isArray(compiler.compilers)) {
1414
compiler.compilers.forEach(function(c, idx) {
1515
c.apply(new CachePlugin(this.cache[idx] = this.cache[idx] || {}));
1616
}, this);
@@ -19,13 +19,13 @@ CachePlugin.prototype.apply = function(compiler) {
1919
compilation.cache = this.cache;
2020
}.bind(this));
2121
compiler.plugin("run", function(compiler, callback) {
22-
if (!compiler._lastCompilationFileDependencies) return callback();
22+
if(!compiler._lastCompilationFileDependencies) return callback();
2323
var fs = compiler.inputFileSystem;
2424
var fileTs = compiler.fileTimestamps = {};
2525
async.forEach(compiler._lastCompilationFileDependencies, function(file, callback) {
2626
fs.stat(file, function(err, stat) {
27-
if (err) {
28-
if (err.code === "ENOENT") return callback();
27+
if(err) {
28+
if(err.code === "ENOENT") return callback();
2929
return callback(err);
3030
}
3131

0 commit comments

Comments
 (0)