Since the function returns true or error I would expect it to not throw exceptions. Also like this it's not a drop-in replacement of original validator looks like
function validateXml(value: string): boolean {
try {
value = 'Not really an xml';
return SyntaxValidator.validate(value) === true;
}
catch {
return false;
}
}
Since the function returns true or error I would expect it to not throw exceptions. Also like this it's not a drop-in replacement of original validator looks like