You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Type classes have many methods which are identical except for the class name before .prototype.
To keep the code more DRY, it would be nice to have these in their own file and include them as mixins for the Type classes (e.g., TypeString, TypeBoolean, etc.).
Some of the methods ripe for extraction include:
_getDefaultFields()
validator()
default()
options()
required()
optional()
validate() - The first several lines of this method could call a common mixin method
checkType() - This may be renamed/refactored soon, so the name may not be right
Alternatively, if mixins are not desired, there could be a Type base class that all other types inherit from.
The text was updated successfully, but these errors were encountered:
The Type classes have many methods which are identical except for the class name before
.prototype
.To keep the code more DRY, it would be nice to have these in their own file and include them as mixins for the Type classes (e.g.,
TypeString
,TypeBoolean
, etc.).Some of the methods ripe for extraction include:
_getDefaultFields()
validator()
default()
options()
required()
optional()
validate()
- The first several lines of this method could call a common mixin methodcheckType()
- This may be renamed/refactored soon, so the name may not be rightAlternatively, if mixins are not desired, there could be a
Type
base class that all other types inherit from.The text was updated successfully, but these errors were encountered: