summaryrefslogtreecommitdiff
path: root/toml/parser.ts
diff options
context:
space:
mode:
authorVincent LE GOFF <g_n_s@hotmail.fr>2019-04-14 16:53:19 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-04-14 10:53:19 -0400
commitd2d5b6ac8e25bc2046b1960b9a1d22e219299cb9 (patch)
tree40f4d34f989fc391ec2b6dbd287b0a0ee486d936 /toml/parser.ts
parentfcb8e6762618965123200fe945ebc2f69e6b3cdd (diff)
Fix eslint warnings and small clean ups (denoland/deno_std#339)
Original: https://github.com/denoland/deno_std/commit/95ab4e2a3c8ac5fd7a1175567848ba7c2161b9e3
Diffstat (limited to 'toml/parser.ts')
-rw-r--r--toml/parser.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/toml/parser.ts b/toml/parser.ts
index a7dd97750..c29f5a761 100644
--- a/toml/parser.ts
+++ b/toml/parser.ts
@@ -1,5 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { existsSync } from "../fs/exists.ts";
+import { readFileStrSync } from "../fs/read_file_str.ts";
import { deepAssign } from "../util/deep_assign.ts";
import { pad } from "../strings/pad.ts";
@@ -542,7 +543,6 @@ export function parseFile(filePath: string): object {
if (!existsSync(filePath)) {
throw new Error("File not found");
}
- const decoder = new TextDecoder();
- const strFile = decoder.decode(Deno.readFileSync(filePath));
+ const strFile = readFileStrSync(filePath);
return parse(strFile);
}