Skip to content

Commit

Permalink
feat: add missing feedback from bruteforce matcher
Browse files Browse the repository at this point in the history
Modify `Matcher` base interface so that Error message contains runtime
type of overloading class - to ease up debugging.
  • Loading branch information
SPodjasek committed Sep 1, 2023
1 parent e7eb509 commit ffdc01e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/dart_zxcvbn/lib/src/matcher/bruteforce.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ class BruteForceMatcher extends Matcher {

return max(guesses, minGuesses);
}

@override
feedback(EstimatedGuessesMixin match, bool isSoleMatch) => null;
}
6 changes: 3 additions & 3 deletions packages/dart_zxcvbn/lib/src/matcher/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ abstract interface class Matcher {

/// TODO make this abstract when all matchers are implemented
dynamic scoring(Match match) {
throw UnimplementedError();
throw UnimplementedError('scoring() not implemented on $runtimeType');
}

/// TODO make this abstract when all matchers are implemented
Feedback feedback(EstimatedGuessesMixin match, bool isSoleMatch) {
throw UnimplementedError();
Feedback? feedback(EstimatedGuessesMixin match, bool isSoleMatch) {
throw UnimplementedError('feedback() not implemented on $runtimeType');
}
}

0 comments on commit ffdc01e

Please sign in to comment.