Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit a024673

Browse files
author
Cdok
committed
slight refactor to recursive removeLeadingNewlines
1 parent b085b1b commit a024673

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

copyright/copyright.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ const buildSupportedExtensions = () => {
6969
* @return {String} new file with no leading \n
7070
*/
7171
const removeLeadingNewlines = (content) => {
72-
if (content[0] === '') {
73-
content.shift()
74-
removeLeadingNewlines(content)
72+
if (content[0] !== '') {
73+
return content
7574
}
76-
return content
75+
content.shift()
76+
return removeLeadingNewlines(content)
7777
}
7878

7979
if (args.length === 0 || args.indexOf('--help') >= 0) {

0 commit comments

Comments
 (0)