/utils/jsonParser

The jsonParser utility is used to parse a locale to be stored as a userLocale.

Methods

(inner) assignValue(target, key, value) → {Boolean}

Returns true if a true, false, null, string, or num value can be assigned to the target object.

Returns true if undefined value is skipped.

Parameters:
NameTypeDescription
targetObject
keystring
value*
Returns:

True if the value has been assigned.

Type: 
Boolean

(inner) excludeProperty(value) → {Boolean}

The excludeProperty method returns true if a property should be exluded from the target in the propertyParser iteration.

Parameters:
NameTypeDescription
value*
Returns:

True if the property should be excluded in regards to the property value.

Type: 
Boolean

(inner) isObject Checks whether the item argument is an object but not true, false, null, or an array.(item) → {Boolean}

Parameters:
NameTypeDescription
item*
Returns:

True if the item is an object but not true, false, null, or an array.

Type: 
Boolean

(inner) jsonParser(obj) → {Object}

The jsonParser returns an object which can be stored in an object store.

The jsonParser method resets the arrays to hold parsed objects and removes the parser flags from all object in these arrays before returning the jsonObject with parsed properties from the obj param.

Parameters:
NameTypeDescription
objObject

A decorated object.

Returns:

Returns a JSON object which can be stored in an object store.

Type: 
Object

(inner) propertyParser(target, source)

The propertyParser parses a source object and assigns properties which can be stored in an object store to the target object.

Parameters:
NameTypeDescription
targetObject
sourceObject