mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
Update flatten method signature (#27752)
This commit is contained in:
committed by
Sheetal Nandi
parent
48a6bcba6f
commit
459a7bd262
3
types/json2csv/JSON2CSVBase.d.ts
vendored
3
types/json2csv/JSON2CSVBase.d.ts
vendored
@@ -92,9 +92,10 @@ declare abstract class JSON2CSVBase<T> {
|
||||
* Performs the flattening of a data row recursively
|
||||
*
|
||||
* @param {object} dataRow Original JSON object
|
||||
* @param {string} separator Separator to be used as the flattened field name
|
||||
* @returns {object} Flattened object
|
||||
*/
|
||||
protected flatten(dataRow: T): object;
|
||||
protected flatten(dataRow: T, separator: string): object;
|
||||
|
||||
/**
|
||||
* Performs the unwind recursively in specified sequence
|
||||
|
||||
3
types/json2csv/JSON2CSVTransform.d.ts
vendored
3
types/json2csv/JSON2CSVTransform.d.ts
vendored
@@ -80,9 +80,10 @@ declare class JSON2CSVTransform<T> extends Transform { // implements JSON2CSVBas
|
||||
* Performs the flattening of a data row recursively
|
||||
*
|
||||
* @param {object} dataRow Original JSON object
|
||||
* @param {string} separator Separator to be used as the flattened field name
|
||||
* @returns {object} Flattened object
|
||||
*/
|
||||
protected flatten(dataRow: T): object;
|
||||
protected flatten(dataRow: T, separator: string): object;
|
||||
|
||||
/**
|
||||
* Performs the unwind recursively in specified sequence
|
||||
|
||||
2
types/json2csv/index.d.ts
vendored
2
types/json2csv/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for json2csv 4.1
|
||||
// Type definitions for json2csv 4.2
|
||||
// Project: https://github.com/zemirco/json2csv
|
||||
// Definitions by: Juanjo Diaz <https://github.com/juanjoDiaz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
@@ -76,7 +76,7 @@ class ParserExt extends Parser<ExampleObj> {
|
||||
s = this.processValue(new Date(), true);
|
||||
s = this.processValue({}, true);
|
||||
s = this.processValue([], true);
|
||||
const flattenedData: object = this.flatten({});
|
||||
const flattenedData: object = this.flatten({}, '.');
|
||||
const unwindedData: object[] = this.unwindData([], []);
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ class TransformExt extends Transform<ExampleObj> {
|
||||
s = this.processValue(new Date(), true);
|
||||
s = this.processValue({}, true);
|
||||
s = this.processValue([], true);
|
||||
const flattenedData: object = this.flatten({});
|
||||
const flattenedData: object = this.flatten({}, '.');
|
||||
const unwindedData: object[] = this.unwindData([], []);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user