serializr
    Preparing search index...

    Function deserialize

    • Deserializes a json structure into an object graph.

      This process might be asynchronous (for example if there are references with an asynchronous lookup function). The function returns an object (or array of objects), but the returned object might be incomplete until the callback has fired as well (which might happen immediately)

      Type Parameters

      • T

      Parameters

      • modelschema: ClazzOrModelSchema<T>
      • jsonArray: any[]
      • Optionalcallback: (err: any, result: T[]) => void

        node style callback that is invoked once the deserialization has finished. First argument is the optional error, second argument is the deserialized object (same as the return value)

      • OptionalcustomArgs: any

        custom arguments that are available as context.args during the deserialization process. This can be used as dependency injection mechanism to pass in, for example, stores.

      Returns T[]

      deserialized object, possibly incomplete.

    • Deserializes a json structure into an object graph.

      This process might be asynchronous (for example if there are references with an asynchronous lookup function). The function returns an object (or array of objects), but the returned object might be incomplete until the callback has fired as well (which might happen immediately)

      Type Parameters

      • T

      Parameters

      • modelschema: ClazzOrModelSchema<T>
      • json: any

        data to deserialize

      • Optionalcallback: (err: any, result: T) => void

        node style callback that is invoked once the deserialization has finished. First argument is the optional error, second argument is the deserialized object (same as the return value)

      • OptionalcustomArgs: any

        custom arguments that are available as context.args during the deserialization process. This can be used as dependency injection mechanism to pass in, for example, stores.

      Returns T

      deserialized object, possibly incomplete.