Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: tools/gardening/lib/src/util.dart

Issue 2993913002: Add filtering to 'summary' (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gardening/bin/summary.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gardening/lib/src/util.dart
diff --git a/tools/gardening/lib/src/util.dart b/tools/gardening/lib/src/util.dart
index f21703aba560c0d9c327e1afa43612dcc5ac5d86..51b50c1e3dec79d037401a16254d3a4046ee07ee 100644
--- a/tools/gardening/lib/src/util.dart
+++ b/tools/gardening/lib/src/util.dart
@@ -10,6 +10,18 @@ import 'package:args/args.dart';
import 'cache.dart';
+/// Checks that [haystack] contains substring [needle], case insensitive.
+/// Throws an exception if either parameter is `null`.
+bool containsIgnoreCase(String haystack, String needle) {
+ if (haystack == null) {
+ throw "Unexpected null as the first paramter value of containsIgnoreCase";
+ }
+ if (needle == null) {
+ throw "Unexpected null as the second parameter value of containsIgnoreCase";
+ }
+ return haystack.toLowerCase().contains(needle.toLowerCase());
+}
+
/// Split [text] using [infixes] as infix markers.
List<String> split(String text, List<String> infixes) {
List<String> result = <String>[];
« no previous file with comments | « tools/gardening/bin/summary.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698