filesystemSanitiseValidate function
String
filesystemSanitiseValidate(
{ - required String inputString,
- required bool throwIfInvalid,
})
Implementation
String filesystemSanitiseValidate({
required String inputString,
required bool throwIfInvalid,
}) {
final FilesystemSanitiserResult output =
FMTC.instance.settings.filesystemSanitiser(inputString);
if (throwIfInvalid && output.errorMessages.isNotEmpty) {
throw InvalidFilesystemString(
'The input string was unsuitable for filesystem use, due to the following reasons:\n${output.errorMessages.map((e) => ' - $e').join('\n')}',
);
}
return output.validOutput;
}