Fix failing unit tests in browser (#5688)

* format js files using prettier

Used the following command to format the files
prettier --write "browser/app/js/**/*.js"

* fix failing unit tests in browser
This commit is contained in:
Kanagaraj M
2018-03-23 00:55:56 +05:30
committed by Harshavardhana
parent cb3818be27
commit c0e45f9098
95 changed files with 839 additions and 890 deletions

View File

@@ -49,7 +49,7 @@ export const sortObjectsByDate = (objects, order) => {
let files = objects.filter(object => !object.name.endsWith("/"))
files = files.sort(
(a, b) =>
new Date(a.lastModified).getTime() - new Date(b.lastModified).getTime(),
new Date(a.lastModified).getTime() - new Date(b.lastModified).getTime()
)
if (order) files = files.reverse()
return [...folders, ...files]
@@ -62,21 +62,21 @@ export const pathSlice = path => {
if (!path)
return {
bucket,
prefix,
prefix
}
let objectIndex = path.indexOf("/", 1)
if (objectIndex == -1) {
bucket = path.slice(1)
return {
bucket,
prefix,
prefix
}
}
bucket = path.slice(1, objectIndex)
prefix = path.slice(objectIndex + 1)
return {
bucket,
prefix,
prefix
}
}