From 38040a91212a7029f5faa6b24e193fe37c8f38f8 Mon Sep 17 00:00:00 2001 From: JonLuca DeCaro Date: Wed, 6 Jul 2022 16:52:58 -0400 Subject: [PATCH] change variable name --- src/helpers/format.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/helpers/format.js b/src/helpers/format.js index 4eecbf0..fad620c 100644 --- a/src/helpers/format.js +++ b/src/helpers/format.js @@ -63,30 +63,30 @@ function singleQuoteEscape (value) { * * @returns {string} Formatted string */ -exports.format = function format (value, ...format) { +exports.format = function format (value, ...formatVariables) { if (typeof value !== 'string') return '' let i = 0 value = value.replace(/(? { // JSON-stringify if (m === '%v') { - const [elem] = format.splice(i, 1) + const [elem] = formatVariables.splice(i, 1) return JSON.stringify(elem) } // Escape for double-quoted string if (m === '%qd') { - const [elem] = format.splice(i, 1) + const [elem] = formatVariables.splice(i, 1) return doubleQuoteEscape(elem) } // Escape for single-quoted string if (m === '%qs') { - const [elem] = format.splice(i, 1) + const [elem] = formatVariables.splice(i, 1) return singleQuoteEscape(elem) } i += 1 return m }) - const ret = util.format(value, ...format) + const ret = util.format(value, ...formatVariables) return ret }