fix: add an initial value to "reduce()" call (#238)

This commit is contained in:
Ismo Vuorinen
2024-05-05 15:27:18 +03:00
committed by GitHub
parent 0e31384a0b
commit 52372dbe37

View File

@@ -3,7 +3,7 @@
const configurationPaths = require('../lib/configuration-paths') const configurationPaths = require('../lib/configuration-paths')
const configItems = configurationPaths('`[module name]`') const configItems = configurationPaths('`[module name]`')
const longestLine = configItems.reduce((a, b) => (a.length > b.length ? a : b)).length const longestLine = configItems.reduce((a, b) => (a.length > b.length ? a : b), 0).length
const mdTable = configItems.map(file => { const mdTable = configItems.map(file => {
const diff = longestLine - file.length const diff = longestLine - file.length