serby / schemata

Define, create, and validate your business objects based on specified schema.
45 stars 16 forks source link

Casting and renaming #54

Open devel-pa opened 5 years ago

devel-pa commented 5 years ago

Hi,

I just started to use your library and helps me, nice job.

There is any way, when casting, to rename the properties (as ex. to in case renaming to something else or 'from' in case renaming from something)

As an extra question, there is any way to cast an object and any missing values to be set as default values? Yes, I know, like below, but with property renaming becomes pretty big.

{
  ...Schema.makeDefault(),
  ...Schema.cast({...}),
}

Thx,

Paul