Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 2.67 KB

util.md

File metadata and controls

69 lines (51 loc) · 2.67 KB

Functions

parseCSV(csvFilePath, attributeFields)Promise

parseCSV - Parses a CSV file into a hierarchy structure.

parseJSON(jsonFilePath)Promise

parseJSON - Parses a hierarchical JSON file that requires no further transformation.

parseFlatJSON(jsonFilePath, attributeFields)Promise

parseFlatJSON - Parses a flat JSON file into a hierarchy structure.

generateHierarchy(flatArray)array.<object>

generateHierarchy - Generates a hierarchical array from a flat array of links.

parseCSV(csvFilePath, attributeFields) ⇒ Promise

parseCSV - Parses a CSV file into a hierarchy structure.

Kind: global function
Returns: Promise - Returns hierarchy array if resolved, error object if rejected.

Param Type Description
csvFilePath string Path to CSV file to be parsed.
attributeFields array.<string> | undefined Set of column names to be used as attributes (optional)

parseJSON(jsonFilePath) ⇒ Promise

parseJSON - Parses a hierarchical JSON file that requires no further transformation.

Kind: global function
Returns: Promise - Returns hierarchy array if resolved, error object if rejected.

Param Type Description
jsonFilePath string Path to JSON file to be parsed.

parseFlatJSON(jsonFilePath, attributeFields) ⇒ Promise

parseFlatJSON - Parses a flat JSON file into a hierarchy structure.

Kind: global function
Returns: Promise - Returns hierarchy array if resolved, error object if rejected.

Param Type Description
jsonFilePath string Path to flat JSON file to be parsed.
attributeFields array.<string> | undefined Set of link fields to be used as attributes

generateHierarchy(flatArray) ⇒ array.<object>

generateHierarchy - Generates a hierarchical array from a flat array of links.

Kind: global function
Returns: array.<object> - Hierarchical single-element array.

Param Type Description
flatArray array.<object> Flat array of link objects