Skip to content

Commit 89a8340

Browse files
committed
Use some more modern JS features
1 parent 1213eeb commit 89a8340

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

index.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ const reporter = require('postcss-reporter/lib/formatter')()
1717
const argv = require('./lib/args')
1818
const depGraph = require('./lib/depGraph')
1919

20-
const dir = argv.dir
21-
2220
let input = argv._
23-
const output = argv.output
21+
const { dir, output } = argv
2422

2523
if (argv.map) argv.map = { inline: false }
2624

@@ -101,10 +99,10 @@ Promise.resolve()
10199
watcher.on('ready', printMessage).on('change', file => {
102100
let recompile = []
103101

104-
if (~input.indexOf(file)) recompile.push(file)
102+
if (input.includes(file)) recompile.push(file)
105103

106104
recompile = recompile.concat(
107-
depGraph.dependantsOf(file).filter(file => ~input.indexOf(file))
105+
depGraph.dependantsOf(file).filter(file => input.includes(file))
108106
)
109107

110108
if (!recompile.length) recompile = input
@@ -136,7 +134,7 @@ function rc(ctx, path) {
136134
return rc
137135
})
138136
.catch(err => {
139-
if (err.message.indexOf('No PostCSS Config found') === -1) throw err
137+
if (!err.message.includes('No PostCSS Config found')) throw err
140138
})
141139
}
142140

0 commit comments

Comments
 (0)