From f9ed5fa0ca57b02b696f698e9930d7de4d15950b Mon Sep 17 00:00:00 2001 From: Oleksii Husakov Date: Tue, 17 Oct 2023 12:23:09 +0300 Subject: [PATCH] chore: adjust mapObjectDeep function to accept false as a result of mapValue --- src/js/esse/schemaUtils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/esse/schemaUtils.js b/src/js/esse/schemaUtils.js index d7f4c8adf..a4675580e 100644 --- a/src/js/esse/schemaUtils.js +++ b/src/js/esse/schemaUtils.js @@ -12,7 +12,9 @@ export function mapObjectDeep(object, mapValue) { } const entries = Object.entries(object).map(([key, value]) => { - return [key, mapValue(value) || mapObjectDeep(value, mapValue)]; + const res = mapValue(value); + + return [key, res === undefined ? mapObjectDeep(value, mapValue) : res]; }); return Object.fromEntries(entries);