From 091923e3c989c37ac9a6ae0d09799a2ff236c5db Mon Sep 17 00:00:00 2001 From: Aleksandr Shumilov Date: Fri, 1 Sep 2023 08:19:27 +0200 Subject: [PATCH] fix: case --- .../src/v100.0.0/__testfixtures__/default.input.tsx | 2 ++ .../src/v100.0.0/__testfixtures__/default.output.tsx | 2 ++ packages/picasso-codemod/src/v100.0.0/spacing-values.ts | 7 +++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/picasso-codemod/src/v100.0.0/__testfixtures__/default.input.tsx b/packages/picasso-codemod/src/v100.0.0/__testfixtures__/default.input.tsx index 663dd1f7248..fa04bd5a59e 100644 --- a/packages/picasso-codemod/src/v100.0.0/__testfixtures__/default.input.tsx +++ b/packages/picasso-codemod/src/v100.0.0/__testfixtures__/default.input.tsx @@ -5,6 +5,7 @@ import { Container } from '@toptal/picasso' const test = 'large' const booleanVariable = true +const extraProps = { align: 'left '} export default () => ( <> @@ -13,6 +14,7 @@ export default () => ( Content Content Content + Content ( <> @@ -14,6 +15,7 @@ export default () => ( Content Content Content + Content { .forEach(element => { const updatedElementAttributes = element.node.openingElement.attributes.map(attribute => { - const attributeName = attribute.name.name + const attributeName = attribute.name?.name - if (AFFECTED_ATTRIBUTES.indexOf(attributeName) === -1) { + if ( + !attributeName || + AFFECTED_ATTRIBUTES.indexOf(attributeName) === -1 + ) { return attribute }