scotthovestadt / schema-object

Enforce schema on JavaScript objects, including type, transformation, and validation. Supports extends, sub-schemas, and arrays.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide static function to typecast fields and return raw object

scotthovestadt opened this issue · comments

When you just want to typecast an object passing through but don't want to pass on an instance of SchemaObject, support this syntax:

User.toObject({ .. })

Instead of:

(new User({ .. })).toObject()