Skip to content

Support for optional data formatting based on the serialization strategy #82

Description

@BerciTheBeast

I propose the addition of optional formatting of values based on the serialization strategy that was used.

Example:
In model:

@prop(...)
public firstName: string;

@prop({
...
    serializable: ['short', 'full'],
    //some formatting logic based on serialization
})
public lastName: string;

Usage:

user.serialize('short'); // {firstName: 'John', lastName: 'S.'}
user.serialize('full'); // {firstName: 'John', lastName: 'Smith'}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions