mekanika / skematic

Data model & rule engine for JS objects
9 stars 0 forks source link

Subsume createFrom into .format() #18

Closed cayuu closed 8 years ago

cayuu commented 9 years ago

Technically 'createFrom' is a special case of format, with the only difference from default behaviour being that it initialises every key on the schema to undefined and then applies defaults + transforms.

If there was a {stubAllFields: true} (or similar) flag for format, then an entire API call could be removed.

*under consideration

cayuu commented 9 years ago

Very strongly leaning to :+1: this proposal. Having an "extra" method on the API is inconsistent. The question simply becomes, "what's the best way to flag createFrom on the format()?"