Skip to content

Commit 27c2e1a

Browse files
committed
refactor(node): Extract a long condition to a variable
Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent a157d07 commit 27c2e1a

File tree

1 file changed

+5
-5
lines changed
  • plugins/package-managers/node/src/main/kotlin/npm

1 file changed

+5
-5
lines changed

plugins/package-managers/node/src/main/kotlin/npm/Npm.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,11 @@ internal fun List<String>.groupLines(vararg markers: String): List<String> {
307307
}
308308

309309
// If no lines but the last end with a dot, assume the message to be a single sentence.
310-
return if (
311-
nonFooterLines.size > 1 &&
312-
nonFooterLines.last().endsWith('.') &&
313-
nonFooterLines.subList(0, nonFooterLines.size - 1).none { it.endsWith('.') }
314-
) {
310+
val isMultiLineSentence = nonFooterLines.size > 1
311+
&& nonFooterLines.last().endsWith('.')
312+
&& nonFooterLines.subList(0, nonFooterLines.size - 1).none { it.endsWith('.') }
313+
314+
return if (isMultiLineSentence) {
315315
listOf(nonFooterLines.joinToString(" "))
316316
} else {
317317
nonFooterLines.map { it.trim() }

0 commit comments

Comments
 (0)