remove unnecessary path.resolve in move/readJson/writeJson (denoland/deno_std#292)

Original: a00c51b05b
This commit is contained in:
Axetroy 2019-03-20 01:23:22 +08:00 committed by Ryan Dahl
parent eaa795d477
commit adb19cbae3
4 changed files with 16 additions and 19 deletions

View file

@ -1,9 +1,7 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import * as path from "./path/mod.ts";
/** Reads a JSON file and then parses it into an object */
export async function readJson(filePath: string): Promise<any> {
filePath = path.resolve(filePath);
const decoder = new TextDecoder("utf-8");
const content = decoder.decode(await Deno.readFile(filePath));
@ -18,7 +16,6 @@ export async function readJson(filePath: string): Promise<any> {
/** Reads a JSON file and then parses it into an object */
export function readJsonSync(filePath: string): any {
filePath = path.resolve(filePath);
const decoder = new TextDecoder("utf-8");
const content = decoder.decode(Deno.readFileSync(filePath));