node-json-db
    Preparing search index...

    Serializer for JavaScript Map objects. Serializes a Map as an array of key-value pairs.

    { "__type": "Map", "__value": [["key1", "value1"], ["key2", "value2"]] }
    

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    type: "Map"

    Unique type identifier stored as __type in the serialized JSON.

    Methods

    • Deserialize a value from its JSON representation. The input is the __value from the serialized JSON.

      Parameters

      • value: [any, any][]

        The stored JSON value

      Returns Map<any, any>

      The deserialized runtime value

    • Serialize a value to a JSON-compatible representation. The returned value will be stored under __value in the serialized JSON.

      Parameters

      • value: Map<any, any>

        The value to serialize

      Returns [any, any][]

      A JSON-compatible value

    • Test if a runtime value should be handled by this serializer.

      Parameters

      • value: any

        The value to test

      Returns boolean

      true if this serializer should handle this value