Module: mathsync/string

mathsync/string

String based serialization and deserialization.
Source:

Methods

<static> newDeserializer(func) → {Serial~Deserialize}

Deserializes objects from bytes to a string view.
Parameters:
Name Type Argument Description
func function <optional>
retrieves an object corresponding to the input string view, can be skipped if target type is string.
Source:
Returns:
a deserializer function which reads strings from byte arrays and converts them to objects.
Type
Serial~Deserialize

<static> newSerializer(func) → {Serial~Serialize}

Serializes string view of objects to bytes.
Parameters:
Name Type Argument Description
func function <optional>
translates objects to string before serializing them, can be skipped if the item is already a string.
Source:
Returns:
a serializer function which converts objects to string and take the bytes out of the string.
Type
Serial~Serialize