Skip to content

Commit

Permalink
Revert "remove unused file"
Browse files Browse the repository at this point in the history
This reverts commit 9f78921.
  • Loading branch information
CFenner committed Jan 4, 2024
1 parent 94afe49 commit e9842a9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions String.format.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// add string format method
if (!String.prototype.format) {
// eslint-disable-next-line no-extend-native
String.prototype.format = function () {
const args = arguments
return this.replace(/{(\d+)}/g, function (match, number) {
return typeof args[number] !== 'undefined'
? args[number]
: match
})
}
}

0 comments on commit e9842a9

Please sign in to comment.