Skip to content

Commit a1011ba

Browse files
jonlucapimterry
authored andcommitted
change variable name
1 parent 95aea46 commit a1011ba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/helpers/format.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,30 +63,30 @@ function singleQuoteEscape (value) {
6363
*
6464
* @returns {string} Formatted string
6565
*/
66-
exports.format = function format (value, ...format) {
66+
exports.format = function format (value, ...formatVariables) {
6767
if (typeof value !== 'string') return ''
6868

6969
let i = 0
7070
value = value.replace(/(?<!%)%([sdifjoOcv]|q[sd])/g, (m) => {
7171
// JSON-stringify
7272
if (m === '%v') {
73-
const [elem] = format.splice(i, 1)
73+
const [elem] = formatVariables.splice(i, 1)
7474
return JSON.stringify(elem)
7575
}
7676
// Escape for double-quoted string
7777
if (m === '%qd') {
78-
const [elem] = format.splice(i, 1)
78+
const [elem] = formatVariables.splice(i, 1)
7979
return doubleQuoteEscape(elem)
8080
}
8181
// Escape for single-quoted string
8282
if (m === '%qs') {
83-
const [elem] = format.splice(i, 1)
83+
const [elem] = formatVariables.splice(i, 1)
8484
return singleQuoteEscape(elem)
8585
}
8686
i += 1
8787
return m
8888
})
8989

90-
const ret = util.format(value, ...format)
90+
const ret = util.format(value, ...formatVariables)
9191
return ret
9292
}

0 commit comments

Comments
 (0)