From bfc75f587247b36044914093fae42f6e29f705b4 Mon Sep 17 00:00:00 2001 From: Sam Lanning Date: Tue, 11 Dec 2018 11:51:31 -0800 Subject: [PATCH] [chore] remove unneeded checks args will always be defined, and an array, additionally Array.some() will always return false if the array is empty. So these conditions are uneeded. --- components/modal/confirm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/modal/confirm.tsx b/components/modal/confirm.tsx index 29f604ec3e..56dcf2e8f3 100644 --- a/components/modal/confirm.tsx +++ b/components/modal/confirm.tsx @@ -136,7 +136,7 @@ export default function confirm(config: ModalFuncProps) { if (unmountResult && div.parentNode) { div.parentNode.removeChild(div); } - const triggerCancel = args && args.length && args.some(param => param && param.triggerCancel); + const triggerCancel = args.some(param => param && param.triggerCancel); if (config.onCancel && triggerCancel) { config.onCancel(...args); }