Module: convertJsonToTypedMap

convertJsonToTypedMap
Source:

Methods

(inner) convertJsonToTypedMap(json) → {Map}

Converts a JSON object to a Typed Map based on Keys and Paths. See here for more details about Typed Maps.
Parameters:
Name Type Description
json Object JSON object to convert
Source:
Throws:
Throws an error if error occurred when converting JSON to Typed Map
Returns:
Typed Map of JSON object
Type
Map

(inner) getArrayType(input) → {Object}

Get Type of an Array
Parameters:
Name Type Description
input Array Input Array to get type of
Source:
Returns:
Type of Array (array, object, types)
Type
Object

(inner) traverseArray(path, input, typedMap)

Convert Array to Typed Map Entry
Parameters:
Name Type Description
path Array.<string> Keys already traversed to get to the input
input Array Input Array to Convert
typedMap Map Typed Map being added to
Source:
Throws:
Throws an error when a Key already exists in typedMap

(inner) traverseJson(path, input, typedMap)

Routes JSON to Typed Map Conversion based on input type
Parameters:
Name Type Description
path Array.<string> Keys already traversed to get to the input
input Array | Object | string | number | boolean | null Input Value
typedMap Map Typed Map being added to
Source:

(inner) traverseObject(path, input, typedMap)

Traverse Object Values to Typed Map Entry
Parameters:
Name Type Description
path Array.<string> Keys already traversed to get to the input
input Object Input Object to traverse
typedMap Map Typed Map being added to
Source:

(inner) traverseSingleValue(path, input, typedMap)

Convert Single Values to Typed Map Entry
Parameters:
Name Type Description
path Array.<string> Keys already traversed to get to the input
input string | number | boolean | null Input Value to Convert
typedMap Map Typed Map being added to
Source:
Throws:
Throws an error when a Key already exists in typedMap