node-json-db
    Preparing search index...

    Serializer for JavaScript Set objects. Serializes a Set as an array of its values.

    { "__type": "Set", "__value": [1, 2, 3] }
    

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    type: "Set"

    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[]

        The stored JSON value

      Returns Set<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: Set<any>

        The value to serialize

      Returns 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