From ecf58008009913f4f636eb46b373d7b8df686d0a Mon Sep 17 00:00:00 2001 From: mhp23 Date: Sat, 17 Feb 2024 09:42:35 +0330 Subject: [PATCH] perf: remove lodash isObject from the linear mapping --- src/layout/createRStyle/mapping/linearMapping.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layout/createRStyle/mapping/linearMapping.ts b/src/layout/createRStyle/mapping/linearMapping.ts index 1feb98a..3f7074b 100644 --- a/src/layout/createRStyle/mapping/linearMapping.ts +++ b/src/layout/createRStyle/mapping/linearMapping.ts @@ -20,9 +20,9 @@ export const linearMapping = ( parentPath: `${parentPath}[${i}]`, }); } - } else if (_.isObject(currentStyle)) { + } else if (typeof currentStyle === 'object' && currentStyle !== null) { for (const [property, currentValue] of Object.entries(currentStyle)) { - if (!_.isObject(currentValue)) { + if (typeof currentValue !== 'object' || currentValue === null) { const parsedVal = parseValue( currentValue as ValuePattern, styleConfig