factory wJSON
- Description:
Implements the JavaScript JSON weak-syntax reader and writer.
Methods
(static) parse(value) → {value}
- Description:
Parses a data structure from a JSON weak-syntax string.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | The value given as a string, using weak JSON syntax. |
Returns:
The parsed data-structure.
- Type
- value
(static) stringify(value, prettyopt) → {string}
- Description:
Converts a data structure the a light weak JSON syntax with a minimal number of quotes.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value |
value | The parsed data-structure. |
||
pretty |
bool |
<optional> |
false
|
|
Returns:
A 2D formated string view of the value.
- Type
- string
(static) wjson2json(value, prettyopt) → {string}
- Description:
Reformats a weak JSON syntax string to a normalized standard JSON format.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value |
string | The input value. |
||
pretty |
bool |
<optional> |
false
|
If true properly format in 2D, else returns a raw format. |
Returns:
The output value.
- Type
- string
(static) wjson2wjson(value, prettyopt, value) → {string}
- Description:
Reformats a strong or weak JSON syntax string to a normalized weak JSON format.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value |
string | The input value. |
||
pretty |
bool |
<optional> |
false
|
|
value |
string | The input value. |
Returns:
The output value.
- Type
- string