From f7b0ea49f5d62671d02c0f251c769d7f47e69b28 Mon Sep 17 00:00:00 2001 From: Oleksii Skorobogatko Date: Mon, 16 Dec 2024 20:58:57 +0200 Subject: [PATCH] #4 refactor param name --- src/renderer/stores/useClipboardStore.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/renderer/stores/useClipboardStore.js b/src/renderer/stores/useClipboardStore.js index 52143a1..bd2766e 100644 --- a/src/renderer/stores/useClipboardStore.js +++ b/src/renderer/stores/useClipboardStore.js @@ -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 {