WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

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

@BerciTheBeast

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'}

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