diff options
author | Ondřej Žára <ondras@zarovi.cz> | 2020-03-31 12:34:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-31 12:34:13 +0200 |
commit | a86b07f2df20b6436291d77d9636061ede0b6c8e (patch) | |
tree | 1cc201a0a84c0cf0ee916256690ddd581ec11f6b /std/encoding | |
parent | bdcb926b37d9ac79b58c66b418a9c37fa746eeb7 (diff) |
used native padStart/End where possible (#4537)
Diffstat (limited to 'std/encoding')
-rw-r--r-- | std/encoding/toml.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/std/encoding/toml.ts b/std/encoding/toml.ts index 53b907fbf..ce4519572 100644 --- a/std/encoding/toml.ts +++ b/std/encoding/toml.ts @@ -1,6 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { deepAssign } from "../util/deep_assign.ts"; -import { pad } from "../strings/pad.ts"; import { assert } from "../testing/asserts.ts"; class KeyValuePair { @@ -514,7 +513,7 @@ class Dumper { } _dateDeclaration(keys: string[], value: Date): string { function dtPad(v: string, lPad = 2): string { - return pad(v, lPad, { char: "0" }); + return v.padStart(lPad, "0"); } const m = dtPad((value.getUTCMonth() + 1).toString()); const d = dtPad(value.getUTCDate().toString()); @@ -542,7 +541,7 @@ class Dumper { } else { const m = rDeclaration.exec(l); if (m) { - out.push(l.replace(m[1], pad(m[1], this.maxPad, { side: "right" }))); + out.push(l.replace(m[1], m[1].padEnd(this.maxPad))); } else { out.push(l); } |