1
0
mirror of https://github.com/sasjs/lint.git synced 2025-12-10 17:34:36 +00:00

fix(*): add empty string fallback to trimComments

This commit is contained in:
Krishna Acondy
2021-04-07 10:57:42 +01:00
parent 64c413d618
commit 2e85cbab2f

View File

@@ -2,7 +2,7 @@ export const trimComments = (
statement: string,
commentStarted: boolean = false
): { statement: string; commentStarted: boolean } => {
let trimmed = statement.trim()
let trimmed = (statement || '').trim()
if (commentStarted || trimmed.startsWith('/*')) {
const parts = trimmed.split('*/')