Class JSON

Index

Methods

Methods

public static decode(json?: string, safe?: boolean): any

[Method] Decodes parses a JSON string to an object

Parameters

  • json?: string optional

    String The JSON string.

  • safe?: boolean optional

    Boolean Whether to return null or throw an exception if the JSON is invalid.

Returns

any

Object/null The resulting object.

public static encode(o?: any): string

[Method] Encodes an Object Array or other value

Parameters

  • o?: any optional

    Object The variable to encode.

Returns

string

String The JSON string.

public static encodeDate(d?: any): string

[Method] Encodes a Date

Parameters

  • d?: any optional

    Date The Date to encode.

Returns

string

String The string literal to use in a JSON string.