From e9f489cea1336ffdb2606540cb742d43864f0792 Mon Sep 17 00:00:00 2001 From: Ika Date: Mon, 2 Jul 2018 16:01:05 +0800 Subject: [PATCH] refactor(debug-repeat): use built-in int type (#4791) --- src/cli/constant.js | 2 +- src/cli/util.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cli/constant.js b/src/cli/constant.js index 7cea1fe9..5bb1db0a 100644 --- a/src/cli/constant.js +++ b/src/cli/constant.js @@ -124,7 +124,7 @@ const options = { }, "debug-repeat": { // Repeat the formatting a few times and measure the average duration. - type: "number", + type: "int", default: 0 }, editorconfig: { diff --git a/src/cli/util.js b/src/cli/util.js index d1007deb..ac5db69c 100644 --- a/src/cli/util.js +++ b/src/cli/util.js @@ -221,8 +221,8 @@ function format(context, input, opt) { ); }) .run({ async: false }); - } else if (+context.argv["debug-repeat"] > 0) { - const repeat = +context.argv["debug-repeat"]; + } else if (context.argv["debug-repeat"] > 0) { + const repeat = context.argv["debug-repeat"]; context.logger.debug( "'--debug-repeat' option found, running formatWithCursor " + repeat + @@ -238,7 +238,7 @@ function format(context, input, opt) { } const averageMs = totalMs / repeat; const results = { - repeat: repeat, + repeat, hz: 1000 / averageMs, ms: averageMs };