From 6d6245bf3df526f96816639b72629e356ada02c2 Mon Sep 17 00:00:00 2001 From: Jacek Pudysz Date: Fri, 30 Aug 2024 12:08:19 +0200 Subject: [PATCH] feat: remove undefined transforms --- src/utils/styles.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/utils/styles.ts b/src/utils/styles.ts index f43d6344..a0d9862f 100644 --- a/src/utils/styles.ts +++ b/src/utils/styles.ts @@ -35,7 +35,16 @@ export const parseStyle = ( // transforms if (key === 'transform' && Array.isArray(value)) { - acc[key] = value.map(value => parseStyle(value, variant)) + acc[key] = value + .map(value => parseStyle(value, variant)) + .filter(value => { + // remove undefined values + if (typeof value === 'object') { + return Object.values(value).at(0) !== undefined + } + + return true + }) return acc }