From 29bf68a047ccbca0e9b3679d739a6cb56961a994 Mon Sep 17 00:00:00 2001 From: Benjamin Wegener Date: Thu, 11 Jan 2024 23:30:55 +0000 Subject: [PATCH] enh(utils) add decrement mechanism --- lib/plugins/Utils.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/plugins/Utils.js b/lib/plugins/Utils.js index 21087b7..b2704f1 100644 --- a/lib/plugins/Utils.js +++ b/lib/plugins/Utils.js @@ -15,7 +15,6 @@ export default class Utils extends CetraPlugin { initComponent(component) {} increment(val, options = { amount: 1 }) { - console.log('increment', val, options); const { amount } = options; return val + amount; } @@ -23,4 +22,13 @@ export default class Utils extends CetraPlugin { increase(val, options = { amount: 1 }) { return this.increment(val, options); } + + decrement(val, options = { amount: 1 }) { + const { amount } = options; + return val - amount; + } + + decrease(val, options = { amount: 1 }) { + return this.decrement(val, options); + } }