Skip to content

Commit

Permalink
#4 refactor param name
Browse files Browse the repository at this point in the history
  • Loading branch information
skoro committed Dec 16, 2024
1 parent 8df8e35 commit f7b0ea4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/renderer/stores/useClipboardStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ export const useClipboardStore = defineStore('clips', () => {
/**
* Gets n top items.
*
* @param {number} n=5 How many items from the top to get.
* @param {number} [max=5] How many items from the top to get.
* @returns {import("../../models/clip").Model[]}
*/
function top(n = 5) {
function top(max = 5) {
if (modelCollection.value.length === 0) {
return [];
}
// TODO: only text items are needed
return modelCollection.value.slice(0, n < 0 ? 10 : n).map(toRaw).reverse();

return modelCollection.value.slice(0, max < 0 ? 10 : max).map(toRaw).reverse();
}

return {
Expand Down

0 comments on commit f7b0ea4

Please sign in to comment.