Skip to content

Commit

Permalink
feat(path utils): nit PE-4923
Browse files Browse the repository at this point in the history
  • Loading branch information
matibat committed Nov 7, 2023
1 parent 4e27368 commit 51ad6b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 3 additions & 5 deletions lib/src/utils/path_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,12 @@ String getFileExtension({
}
}

String getFileTypeFromMime({
required String contentType,
}) {
String getFileTypeFromMime({required String contentType}) {
return contentType.substring(contentType.lastIndexOf('/') + 1);
}

String getBasenameWithoutExtension(String fileName) {
return path.basenameWithoutExtension(fileName);
String getBasenameWithoutExtension({required String filePath}) {
return path.basenameWithoutExtension(filePath);
}

Future<String> _getDefaultIOSDir() async {
Expand Down
4 changes: 3 additions & 1 deletion test/src/utils/path_utils_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ void main() {

group('getBasenameWithoutExtension method', () {
test('should return the basename without extension', () {
final basename = getBasenameWithoutExtension('file.pdf');
final basename = getBasenameWithoutExtension(
filePath: '/hola/que/tal/file.pdf',
);

expect(basename, 'file');
});
Expand Down

0 comments on commit 51ad6b3

Please sign in to comment.