From 80320ffa25ce782170b4062893f1104bd69e10f2 Mon Sep 17 00:00:00 2001 From: Abdeali Chharchhoda Date: Tue, 13 May 2025 16:43:13 +0530 Subject: [PATCH] refactor: simplify source_name assignment in map_current_doc function --- erpnext/public/js/utils.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index f0adfe990e8..9ec15c77cd9 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -1027,11 +1027,7 @@ erpnext.utils.map_current_doc = function (opts) { return; } - if (values.constructor === Array) { - opts.source_name = [...new Set(values)]; - } else { - opts.source_name = values; - } + opts.source_name = Array.isArray(values) ? [...new Set(values)] : values; if ( opts.allow_child_item_selection ||