1
0
mirror of https://github.com/sasjs/lint.git synced 2026-01-15 08:10:05 +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, statement: string,
commentStarted: boolean = false commentStarted: boolean = false
): { statement: string; commentStarted: boolean } => { ): { statement: string; commentStarted: boolean } => {
let trimmed = statement.trim() let trimmed = (statement || '').trim()
if (commentStarted || trimmed.startsWith('/*')) { if (commentStarted || trimmed.startsWith('/*')) {
const parts = trimmed.split('*/') const parts = trimmed.split('*/')