File

src/lib/extensions/json.service.ts

Description

A JSON Parse/Stringify extension that extends the browser behavior of JSON. Supports CMFMaps and ISO 8601 Date parse/stringify.

Index

Methods

Methods

parse
parse(text: string)

Converts a JavaScript Object Notation (JSON) string into an object. It uses a custom reviver that handles dictionaries and ISO 8601 dates.

If a member contains nested objects, the nested objects are transformed before the parent object is.

Parameters :
Name Type Optional Description
text string No

A valid JSON string. If a member contains nested objects, the nested objects are transformed before the parent object is.

Returns : any
parseComplexProperties
parseComplexProperties(obj: any)

Parse all string properties that start with the keyword 'function'. It should be used with the result of @see stringifyFunctionProperties.

Parameters :
Name Type Optional Description
obj any No

The object to have its function properties deserialized.

Returns : any

The object will all its function properties deserialized.

stringify
stringify(data: any)

Converts a JavaScript value to a JavaScript Object Notation (JSON) string.

Parameters :
Name Type Optional
data any No
Returns : string
stringifyComplexProperties
stringifyComplexProperties(obj: any)

Stringify all function properties on the given object. Useful when there is a need to serialize objects with functions has properties.

Parameters :
Name Type Optional Description
obj any No

The object to have its function properties serialized.

Returns : any

The object with all it's function properties serialized.

results matching ""

    No results matching ""