This commit is contained in:
toly
2023-10-21 09:51:20 +08:00
parent d518b3c58a
commit 689e8d9fdb
49 changed files with 3006 additions and 64 deletions

9
test/parser/back.dart Normal file
View File

@@ -0,0 +1,9 @@
void main(){
print(backPath('/a/c/d?k=v'));
}
String backPath(String path){
Uri uri = Uri.parse(path);
List<String> parts = List.of(uri.pathSegments)..removeLast();
return '/${parts.join('/')}';
}