option<T> method
Implementation
T? option<T>(String key, [T? def, TypeElementParser? parser]) {
var value = _options[key];
if (value == null) {
var keyLC = normalizeKey(key);
value = _options[keyLC];
}
if (value == null) return def;
parser ??= TypeParser.parserFor<T>(obj: def);
if (parser != null) {
return parser(value) as T;
} else {
return value as T;
}
}