code: function serialize(instance) {
      if (!utils_1.isTargetType(instance, 'object') || utils_1.isArrayOrArrayClass(instance)) {
          return instance;
      }
      var obj = {};
      Object.keys(instance).forEach(function (key) {
          var metadata = getJsonProperty(instance, key);
          obj[metadata && metadata.name ? metadata.name : key] = serializeProperty(metadata, instance[key]);
      });
      return obj;
  }
docs: Serialize: Creates a ready-for-json-serialization object from the provided model instance.
  Only @JsonProperty decorated properties in the model instance are processed.
  
  @param instance an instance of a model class
  @returns {any} an object ready to be serialized to JSON