Skip to content

Commit

Permalink
Merge pull request #272 from jpudysz/feature/undefined
Browse files Browse the repository at this point in the history
feat: remove undefined transforms
  • Loading branch information
jpudysz authored Aug 30, 2024
2 parents e66c66e + 6d6245b commit 7580965
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/utils/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,16 @@ export const parseStyle = <T extends RNStyle>(

// 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
}
Expand Down

0 comments on commit 7580965

Please sign in to comment.