From 72d95b38f008fed506c6cbf3af8a693bd7c3363a Mon Sep 17 00:00:00 2001 From: hinamiyagk Date: Wed, 3 Feb 2016 22:47:24 +0900 Subject: [PATCH] Add jsonObject parameter to callback and make callback required --- fs-extra/fs-extra-tests.ts | 8 ++++---- fs-extra/fs-extra.d.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index 80655ab5b8..32fc34d76d 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -75,10 +75,10 @@ fs.outputJSON(file, data, errorCallback); fs.outputJsonSync(file, data); fs.outputJSONSync(file, data); -fs.readJson(file, errorCallback); -fs.readJson(file, openOpts, errorCallback); -fs.readJSON(file, errorCallback); -fs.readJSON(file, openOpts, errorCallback); +fs.readJson(file, (error: Error, jsonObject: any) => {}); +fs.readJson(file, openOpts, (error: Error, jsonObject: any) => {}); +fs.readJSON(file, (error: Error, jsonObject: any) => {}); +fs.readJSON(file, openOpts, (error: Error, jsonObject: any) => {}); fs.readJsonSync(file, openOpts); fs.readJSONSync(file, openOpts); diff --git a/fs-extra/fs-extra.d.ts b/fs-extra/fs-extra.d.ts index e4f800185f..b5cba7c083 100644 --- a/fs-extra/fs-extra.d.ts +++ b/fs-extra/fs-extra.d.ts @@ -65,10 +65,10 @@ declare module "fs-extra" { export function outputJsonSync(file: string, data: any): void; export function outputJSONSync(file: string, data: any): void; - export function readJson(file: string, callback?: (err: Error) => void): void; - export function readJson(file: string, options?: OpenOptions, callback?: (err: Error) => void): void; - export function readJSON(file: string, callback?: (err: Error) => void): void; - export function readJSON(file: string, options?: OpenOptions, callback?: (err: Error) => void): void; + export function readJson(file: string, callback: (err: Error, jsonObject: any) => void): void; + export function readJson(file: string, options: OpenOptions, callback: (err: Error, jsonObject: any) => void): void; + export function readJSON(file: string, callback: (err: Error, jsonObject: any) => void): void; + export function readJSON(file: string, options: OpenOptions, callback: (err: Error, jsonObject: any) => void): void; export function readJsonSync(file: string, options?: OpenOptions): any; export function readJSONSync(file: string, options?: OpenOptions): any;