mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-05 20:25:41 +08:00
Fix bug in json2csv options
This commit is contained in:
@@ -17,9 +17,27 @@ parse({});
|
||||
parse([]);
|
||||
parse({}, {});
|
||||
|
||||
interface Car {
|
||||
car: string;
|
||||
price: number;
|
||||
}
|
||||
|
||||
new Parser();
|
||||
const parser: Parser<ExampleObj> = new Parser({});
|
||||
s = parser.parse({ str: '', num: 1, obj: {} });
|
||||
|
||||
const opts: json2csv.Options<Car> = {
|
||||
fields: [{
|
||||
label: 'Car Name',
|
||||
value: 'car'
|
||||
}, {
|
||||
label: 'Price USD',
|
||||
value: 'price'
|
||||
}]
|
||||
};
|
||||
|
||||
const json2csvParser = new Parser<Car>(opts);
|
||||
|
||||
parser.parse([]);
|
||||
const transform: Transform<ExampleObj> = new Transform<ExampleObj>({ quote: '' });
|
||||
const nodeTransform: NodeTransform = transform;
|
||||
|
||||
Reference in New Issue
Block a user