helpers.json - ZeMA-gGmbH/NoPE-JS GitHub Wiki

Namespace: json

helpers.json

Functions

parse

parse(json, withFunctions?): any

Function to parse a JSON String. This Function is able to parse Functions as well. Use the Flag withFunctions

Parameters

Name Type Default value Description
json string undefined A String containing the json Object
withFunctions boolean false Flag to Turn on / off the parsing of functions

Returns

any


parseWithFunctions

parseWithFunctions(json, scope?): any

Function to parse a JSON String, in which methods should be available.

Parameters

Name Type Description
json string A String containing the json Object
scope Object An Scope to use during parsing.

Returns

any


stringify

stringify(obj, withFunctions?): string

Function to stringify an Object. This Function is able to stringify Functions as well. Use the Flag withFunctions

Parameters

Name Type Default value Description
obj any undefined The Object.
withFunctions boolean false Flag to Turn on / off the parsing of functions

Returns

string


stringifyWithFunctions

stringifyWithFunctions(obj, ...args): string

Function to stringify an Object. This Function will stringify Functions as well.

Parameters

Name Type Description
obj any The Object.
...args any[] -

Returns

string