summaryrefslogtreecommitdiff
path: root/std/fmt/printf.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-06-12 09:19:29 -0400
committerGitHub <noreply@github.com>2020-06-12 09:19:29 -0400
commitd0970daacda0b6f6c2077c2f81948536b574bbe9 (patch)
treef116548be832ae6786449dd6f1257865efe38026 /std/fmt/printf.ts
parentca1c2ee82207f2ead857ab4aeca48edff16827ae (diff)
make std deno-lint clean (#6240)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'std/fmt/printf.ts')
-rw-r--r--std/fmt/printf.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/std/fmt/printf.ts b/std/fmt/printf.ts
index 8c2f8d034..bf5feaaed 100644
--- a/std/fmt/printf.ts
+++ b/std/fmt/printf.ts
@@ -221,7 +221,7 @@ class Printf {
flags.width += val;
} // switch c
break;
- case State.PRECISION:
+ case State.PRECISION: {
if (c === "*") {
this.handleWidthOrPrecisionRef(WorP.PRECISION);
break;
@@ -236,6 +236,7 @@ class Printf {
flags.precision *= 10;
flags.precision += val;
break;
+ }
default:
throw new Error("can't be here. bug.");
} // switch state
@@ -627,8 +628,7 @@ class Printf {
switch (typeof val) {
case "number":
return this.fmtNumber(val as number, 16, upper);
- break;
- case "string":
+ case "string": {
const sharp = this.flags.sharp && val.length !== 0;
let hex = sharp ? "0x" : "";
const prec = this.flags.precision;
@@ -647,7 +647,7 @@ class Printf {
hex = hex.toUpperCase();
}
return this.pad(hex);
- break;
+ }
default:
throw new Error(
"currently only number and string are implemented for hex"