serializr
    Preparing search index...

    Function update

    • Similar to deserialize, but updates an existing object instance. Properties will always updated entirely, but properties not present in the json will be kept as is. Further this method behaves similar to deserialize.

      Type Parameters

      • T

      Parameters

      • modelschema: ClazzOrModelSchema<T>
      • instance: T
      • json: any

        the json to deserialize

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

        the callback to invoke once deserialization has completed.

      • 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 void

      deserialized object, possibly incomplete.

    • Similar to deserialize, but updates an existing object instance. Properties will always updated entirely, but properties not present in the json will be kept as is. Further this method behaves similar to deserialize.

      Type Parameters

      • T

      Parameters

      • instance: T
      • json: any

        the json to deserialize

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

        the callback to invoke once deserialization has completed.

      • 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 void

      deserialized object, possibly incomplete.