From 455b7fdb0cb580c1a71a74905af7e332ff061936 Mon Sep 17 00:00:00 2001 From: Beto Muniz Date: Sun, 11 Apr 2021 14:30:49 -0300 Subject: [PATCH] Update condition syntax based on PR reviews --- src/clipboard-action-default.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/clipboard-action-default.js b/src/clipboard-action-default.js index c1c2a47..cf275c4 100644 --- a/src/clipboard-action-default.js +++ b/src/clipboard-action-default.js @@ -39,13 +39,12 @@ class ClipboardActionDefault { container: this.container, }); } else if (this.target) { - if (this.action === 'cut') { - this.selectedText = ClipboardActionCut(this.target); - } else if (this.action === 'copy') { - this.selectedText = ClipboardActionCopy(this.target, { - container: this.container, - }); - } + this.selectedText = + this.action === 'cut' + ? ClipboardActionCut(this.target) + : ClipboardActionCopy(this.target, { + container: this.container, + }); } this.handleResult(Boolean(this.selectedText));