Improved dispatchers with richer results and added predicate and regular expression based dispatchers
This commit is contained in:
@@ -15,6 +15,12 @@ export function typed_value(coercion_function, default_value, description) {
|
||||
return new Field_Configuration(null, coercion_function, () => default_value, description);
|
||||
}
|
||||
|
||||
export function boolean(default_value, description) {
|
||||
//BUG: Text representations such as "false" is still truthy here - we should have a more capable coearcing function
|
||||
return new Field_Configuration(null, Boolean, () => default_value, description);
|
||||
}
|
||||
|
||||
|
||||
export function typed_factory(coercion_function, factory_function, description) {
|
||||
return new Field_Configuration(null, coercion_function, factory_function, description);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user