From 7e55015948755a1403eb1411f4d948c578148924 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Sat, 17 Jun 2023 21:06:29 +0200 Subject: [PATCH] feat: Remove list helpers Use the collection package instead. --- lib/lists.dart | 16 ---------------- lib/moxlib.dart | 1 - 2 files changed, 17 deletions(-) delete mode 100644 lib/lists.dart diff --git a/lib/lists.dart b/lib/lists.dart deleted file mode 100644 index 42cd83d..0000000 --- a/lib/lists.dart +++ /dev/null @@ -1,16 +0,0 @@ -/// A wrapper around List.firstWhere that does not throw but instead just -/// returns true if [test] returns true for an element or false if [test] never -/// returned true. -bool listContains(List list, bool Function(T element) test) { - return firstWhereOrNull(list, test) != null; -} - -/// A wrapper around [List.firstWhere] that does not throw but instead just -/// return null if [test] never returned true -T? firstWhereOrNull(List list, bool Function(T element) test) { - try { - return list.firstWhere(test); - } catch(e) { - return null; - } -} diff --git a/lib/moxlib.dart b/lib/moxlib.dart index 48fa1d2..97206dd 100644 --- a/lib/moxlib.dart +++ b/lib/moxlib.dart @@ -1,5 +1,4 @@ library moxlib; export 'awaitabledatasender.dart'; -export 'lists.dart'; export 'math.dart';