mirror of
https://github.com/denoland/deno.git
synced 2025-10-03 07:34:36 +00:00
parent
a391660d2d
commit
0b4f73cf9d
8 changed files with 34 additions and 82 deletions
|
@ -1,12 +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
|
||||
* @param {string} filePath
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
/** 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");
|
||||
|
@ -21,12 +16,7 @@ export async function readJson(filePath: string): Promise<any> {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a JSON file and then parses it into an object
|
||||
* @export
|
||||
* @param {string} filePath
|
||||
* @returns {void}
|
||||
*/
|
||||
/** 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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue