Skip to content

Commit 307d696

Browse files
FloEdelmannaladdin-add
authored andcommitted
Simplify function parameters
1 parent d379e91 commit 307d696

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tools/lib/configs.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ const path = require('path')
1010
const ROOT = path.resolve(__dirname, '../../lib/configs')
1111
const FLAT = path.resolve(ROOT, 'flat')
1212

13-
function listConfigs(configDir, flat) {
13+
/**
14+
* @param {boolean} flat
15+
* @returns {string[]}
16+
*/
17+
function listConfigs(flat) {
18+
const configDir = flat ? FLAT : ROOT
19+
1420
return fs
1521
.readdirSync(configDir)
1622
.filter((file) => path.extname(file) === '.js')
@@ -21,6 +27,6 @@ function listConfigs(configDir, flat) {
2127
}
2228

2329
module.exports = {
24-
root: listConfigs(ROOT, false),
25-
flat: listConfigs(FLAT, true)
30+
root: listConfigs(false),
31+
flat: listConfigs(true)
2632
}

0 commit comments

Comments
 (0)