commit 76579e3b2e46456ab8bba79ef431bc04b1d2be20
parent 5337501ba9d60ea914c7cb6b5b545a21516c76c4
Author: Jackson G. Kaindume <seestem@merely.tech>
Date: Mon, 4 Jul 2022 14:19:12 +0200
shorter API identifiers
Diffstat:
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/lib/src/drtx_base.dart b/lib/src/drtx_base.dart
@@ -1,10 +1,7 @@
-// Public facing types
-
-/// Functions for string formating
-class StrFmt {
+class X {
/// if a string is has 13 characters or more it return the first 5 characters
/// with 3 (...) dots and the last 5 characters
- static String shrtMidDot(String str) {
+ static String midot(String str) {
if (str.length > 13) {
final start = str.substring(0, 5);
final end = str.substring(str.length - 5);
diff --git a/test/drtx_test.dart b/test/drtx_test.dart
@@ -8,10 +8,10 @@ void main() {
});
test('shrtMidDot', () {
- expect(StrFmt.shrtMidDot("0123456789"), "0123456789");
- expect(StrFmt.shrtMidDot("0123456789ABCDE"), "01234...ABCDE");
+ expect(X.midot("0123456789"), "0123456789");
+ expect(X.midot("0123456789ABCDE"), "01234...ABCDE");
expect(
- StrFmt.shrtMidDot(
+ X.midot(
"0123456kfjdffdfaunfdfnhjfdhfdfdkjdfdfkdfnngfdfjgghjfghfjhgffghfghhjfghjfgjhfghfghjfghgjfghjfghjfghrbebqjewe83929odf;****3774743g789ABCDE"),
"01234...ABCDE");
});