web/satellite: remove ramda dependency
The package was barely used and the amount of code needed to remove it is minor. Also remove top-level package-lock, because it's not being used. Change-Id: Ifb4ec4fe7f4fa36ce6e707a33d47f04c583cbe6c
This commit is contained in:
parent
1d5b3e508c
commit
fe3856ff91
3
package-lock.json
generated
3
package-lock.json
generated
@ -1,3 +0,0 @@
|
||||
{
|
||||
"lockfileVersion": 1
|
||||
}
|
1
web/satellite/package-lock.json
generated
1
web/satellite/package-lock.json
generated
@ -23,7 +23,6 @@
|
||||
"pbkdf2": "3.1.1",
|
||||
"pretty-bytes": "5.6.0",
|
||||
"qrcode": "1.4.4",
|
||||
"ramda": "0.27.1",
|
||||
"stripe": "8.96.0",
|
||||
"vue": "2.6.12",
|
||||
"vue-class-component": "7.2.5",
|
||||
|
@ -28,7 +28,6 @@
|
||||
"pbkdf2": "3.1.1",
|
||||
"pretty-bytes": "5.6.0",
|
||||
"qrcode": "1.4.4",
|
||||
"ramda": "0.27.1",
|
||||
"stripe": "8.96.0",
|
||||
"vue": "2.6.12",
|
||||
"vue-class-component": "7.2.5",
|
||||
|
@ -4,7 +4,6 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import S3 from "aws-sdk/clients/s3";
|
||||
import * as R from "ramda";
|
||||
|
||||
const listCache = new Map();
|
||||
|
||||
@ -52,17 +51,20 @@ export default {
|
||||
size: (a: BrowserObject, b: BrowserObject): number => a.Size - b.Size
|
||||
};
|
||||
|
||||
// sort by appropriate function
|
||||
const sortedFiles = R.sort(fns[state.headingSorted], state.files);
|
||||
// TODO(performance): avoid several passes over the slice.
|
||||
|
||||
// sort by appropriate function
|
||||
const sortedFiles = state.files.slice();
|
||||
sortedFiles.sort(fns[state.headingSorted]);
|
||||
// reverse if descending order
|
||||
const orderedFiles =
|
||||
state.orderBy === "asc" ? sortedFiles : R.reverse(sortedFiles);
|
||||
if(state.orderBy !== "asc") {
|
||||
sortedFiles.reverse();
|
||||
}
|
||||
|
||||
// display folders and then files
|
||||
const groupedFiles = [
|
||||
...orderedFiles.filter((file) => file.type === "folder"),
|
||||
...orderedFiles.filter((file) => file.type === "file")
|
||||
...sortedFiles.filter((file) => file.type === "folder"),
|
||||
...sortedFiles.filter((file) => file.type === "file")
|
||||
];
|
||||
|
||||
return groupedFiles;
|
||||
|
Loading…
Reference in New Issue
Block a user