Skip to content

Commit

Permalink
Fixed linter errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTV12345 committed Aug 4, 2023
1 parent 09dbb5c commit 7861dfa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const search = async (query) => {
query,
total: padIDs.length,
};
let maxResult = 0;
let maxResult;
let result = padIDs;
if (query.pattern != null && query.pattern !== '') {
let pattern = `*${query.pattern}*`;
Expand Down Expand Up @@ -55,9 +55,7 @@ const search = async (query) => {
entry.lastEdited = await pad.getLastEdit();
}));

const sorted = data.results.sort(function(a, b) {
return a.lastEdited - b.lastEdited;
});
const sorted = data.results.sort((a, b) => a.lastEdited - b.lastEdited);
data.results = sorted.slice(query.offset, query.offset + query.limit);

return data;
Expand Down

0 comments on commit 7861dfa

Please sign in to comment.