diff --git a/lib/diagnostic.js b/lib/diagnostic.js index b585e9b..b9e2a1b 100644 --- a/lib/diagnostic.js +++ b/lib/diagnostic.js @@ -70,10 +70,14 @@ function * tokensToDiagnostic (inp, width = 100) { if (!token.type.terminal) { switch (token.type.name) { case 'map': - indent.push(token.value * 2) + if (token.value) { + indent.push(token.value * 2) + } break case 'array': - indent.push(token.value) + if (token.value) { + indent.push(token.value) + } break // TODO: test tags .. somehow /* c8 ignore next 5 */