mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
reduce mandatory requirements
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
String.prototype.format = function (args) { // eslint-disable-line no-extend-native, func-names
|
||||
let thisString = '';
|
||||
for (let charPos = 0; charPos < this.length; charPos++) thisString += this[charPos];
|
||||
for (const key in args) { // eslint-disable-line guard-for-in
|
||||
for (const key in args) {
|
||||
const stringKey = `{${key}}`;
|
||||
thisString = thisString.replace(new RegExp(stringKey, 'g'), args[key]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user