Skip to content

Add JsonConfig decorator #23

@SoEasy

Description

@SoEasy
type TJsonConfig = {
  // name in raw data, default is null. If its null/undefined - library works with name of class-field name
  rawName: string;

  // serializer function, default is null. If its null/undefined - library directly pass value to serialized object
  serialize: (value: any, instance) => any;

  // deserializer function, default is null. If its null/undefined - library directly pass raw value to instance
  deserialize: (value: any, rawObject) => any;

  // should library pass value to serialized object. Default is true
  shouldSerialize: boolean;

  // should library get value from raw object and deserialize it. Default is true
  shouldDeserialize: boolean;
}

@JsonConfig(config: TJsonConfig)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions