Content-Length: 217571 | pFad | https://github.com/expressjs/serve-static/commit/#start-of-content

6793E530 Refactor HISTORY.md header update to use String.prototype.repeat · expressjs/serve-static@2ceda41 · GitHub
Skip to content

Commit

Permalink
Refactor HISTORY.md header update to use String.prototype.repeat
Browse files Browse the repository at this point in the history
Replaced the custom repeat function with String.prototype.repeat to simplify the code and improve readability. This change leverages modern JavaScript functionality, reducing complexity and improving efficiency when updating the HISTORY.md header.
  • Loading branch information
Ayoub-Mabrouk authored and wesleytodd committed Jan 23, 2025
1 parent 96886b3 commit 2ceda41
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions scripts/version-history.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if (historyFileLines[0].indexOf('x') !== -1) {
}

historyFileLines[0] = VERSION + ' / ' + getLocaleDate()
historyFileLines[1] = repeat('=', historyFileLines[0].length)
historyFileLines[1] = '='.repeat(historyFileLines[0].length)

fs.writeFileSync(HISTORY_FILE_PATH, historyFileLines.join('\n'))

Expand All @@ -42,16 +42,6 @@ function getLocaleDate () {
zeroPad(now.getDate(), 2)
}

function repeat (str, length) {
var out = ''

for (var i = 0; i < length; i++) {
out += str
}

return out
}

function zeroPad (number, length) {
return number.toString().padStart(length, '0')
}

0 comments on commit 2ceda41

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/expressjs/serve-static/commit/#start-of-content

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy