Class: ProgressivePair

PSON. ProgressivePair

A progressive PSON encoder and decoder pair.

new ProgressivePair(dict, options)

Constructs a new progressive PSON encoder and decoder pair.

Parameters:
Name Type Argument Description
dict Array.<string> <optional>

Initial dictionary

options Object.<string,*> <optional>

Options

Extends

Methods

decode(pson) → {*}

Decodes PSON to JSON.

Parameters:
Name Type Description
pson ByteBuffer | ArrayBuffer | Buffer

PSON

Inherited From:
Returns:

JSON

Type
*

encode(json) → {ByteBuffer}

Encodes JSON to PSON.

Parameters:
Name Type Description
json *

JSON

Inherited From:
Returns:

PSON

Type
ByteBuffer

exclude(obj)

Alias for PSON.exclude.

Parameters:
Name Type Description
obj Object

Now excluded object

include(obj)

Alias for PSON.include.

Parameters:
Name Type Description
obj Object

New included object

toArrayBuffer(json) → {ArrayBuffer}

Encodes JSON straight to an ArrayBuffer of PSON.

Parameters:
Name Type Description
json *

JSON

Inherited From:
Returns:

PSON as ArrayBuffer

Type
ArrayBuffer

toBuffer(json) → {Buffer}

Encodes JSON straight to a node Buffer of PSON.

Parameters:
Name Type Description
json *

JSON

Inherited From:
Returns:

PSON as node Buffer

Type
Buffer