more regexp foo XD

This commit is contained in:
fuwa
2019-11-28 02:48:37 +08:00
parent f27c433d96
commit 280d988e94
+4 -2
View File
@@ -26,8 +26,10 @@ import 'config.dart' as config;
String pretty(dynamic x) {
final JsonEncoder encoder = JsonEncoder.withIndent(' ');
return encoder.convert(x)
.replaceAll(RegExp(r'["\[\]{},]'), '')
.replaceAll('\n ', '\n');
.replaceAll(RegExp(r'^{'), '\n')
.replaceAll(RegExp(r'["\[\],{}]'), '')
.replaceAll('\n ', '\n')
;
}
String trimHash(String x) => x.substring(0, config.hashLength) + ' ...';