refactor: simplify isValidSortMethod (#2393)
This commit is contained in:
1 parent
c9052ff45d
commit
0348ed384d
1 file changed
+5
-9
@@ -22,15 +22,11 @@ const (
|
||||
)
|
||||
|
||||
func isValidSortMethod(method sortMethod) bool {
|
||||
return method == naturalSort ||
|
||||
method == nameSort ||
|
||||
method == sizeSort ||
|
||||
method == timeSort ||
|
||||
method == atimeSort ||
|
||||
method == btimeSort ||
|
||||
method == ctimeSort ||
|
||||
method == extSort ||
|
||||
method == customSort
|
||||
switch method {
|
||||
case naturalSort, nameSort, sizeSort, timeSort, atimeSort, btimeSort, ctimeSort, extSort, customSort:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
const invalidSortErrorMessage = `sortby: value should either be 'natural', 'name', 'size', 'time', 'atime', 'btime', 'ctime', 'ext' or 'custom'`
|
||||
|
||||
Reference in new issue
Block a user