Skip to content

Commit 04f70c9

Browse files
committed
fix xo:explicit-length-check
1 parent 9e4f8d8 commit 04f70c9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ class NetlifyServerPushPlugin {
2525
let mainJs = '# no js files';
2626
let mainCss = '# no css files';
2727

28-
const hasEsm = Object.keys(compilation.assets).filter(filename => /\.esm\.js$/.test(filename)).length !== 0;
28+
const hasEsm =
29+
Object.keys(compilation.assets).filter(filename =>
30+
/\.esm\.js$/.test(filename)
31+
).length !== 0;
2932

3033
for (const filename in compilation.assets) {
3134
if (!/\.map$/.test(filename)) {
@@ -38,7 +41,7 @@ class NetlifyServerPushPlugin {
3841
} else if (!hasEsm && /^bundle(.+)\.js$/.test(filename)) {
3942
mainJs = `Link: </${filename}>; rel=preload; as=script`;
4043
}
41-
}
44+
}
4245
}
4346

4447
let headers =
@@ -50,7 +53,7 @@ class NetlifyServerPushPlugin {
5053

5154
const redirects = `${this.redirects.join('\n')}\n/* /index.html 200`;
5255

53-
if (!routes.length) {
56+
if (routes.length === 0) {
5457
headers += `\n/*\n\t${mainCss}\n\t${mainJs}`;
5558
}
5659

0 commit comments

Comments
 (0)