mirror of
https://github.com/sasjs/lint.git
synced 2026-01-15 00:00:05 +00:00
fix(*): add empty string fallback to trimComments
This commit is contained in:
@@ -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('*/')
|
||||||
|
|||||||
Reference in New Issue
Block a user