mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
fs-promise: JSON replacer should be a string
This commit is contained in:
@@ -6,7 +6,13 @@ var dir: string;
|
||||
var path: string;
|
||||
var data: any;
|
||||
var writeOptions: fs.WriteOptions;
|
||||
var writeJsonOptions: fs.WriteJsonOptions;
|
||||
var writeJsonOptions: fs.WriteJsonOptions = {
|
||||
spaces: 2,
|
||||
replacer(key, value) {
|
||||
src = key;
|
||||
return value;
|
||||
}
|
||||
};
|
||||
var readJsonOptions: fs.ReadJsonOptions;
|
||||
|
||||
async function test() {
|
||||
|
||||
2
fs-promise/index.d.ts
vendored
2
fs-promise/index.d.ts
vendored
@@ -15,7 +15,7 @@ export interface WriteOptions {
|
||||
|
||||
type JsonReplacerArray = Array<number | string>;
|
||||
|
||||
type JsonReplacerFunction = (key: any, value: any) => any;
|
||||
type JsonReplacerFunction = (key: string, value: any) => any;
|
||||
|
||||
type JsonReplacer = JsonReplacerArray | JsonReplacerFunction;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user