from static method
Implementation
static RegExpDialect? from(
Object? dialect, {
bool multiLine = false,
bool caseSensitive = true,
bool throwCompilationErrors = true,
}) {
if (dialect == null) return null;
if (dialect is RegExpDialect) {
return dialect.withParameters(
multiLine: multiLine,
caseSensitive: caseSensitive,
throwCompilationErrors: throwCompilationErrors,
);
}
if (dialect is Map) {
var map = asMapOfString(dialect)!;
return RegExpDialect(
map,
multiLine: multiLine,
caseSensitive: caseSensitive,
throwCompilationErrors: throwCompilationErrors,
);
}
return null;
}