Skip to content

Commit b506ca1

Browse files
lint fix
1 parent dcc46b0 commit b506ca1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/dataviews/src/dataform-controls/utils/validated-input.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ export default function ValidatedText< Item >( {
5555
);
5656

5757
// Convert pattern to string if it's a RegExp
58-
const pattern = isValid?.pattern
59-
? isValid.pattern instanceof RegExp
60-
? isValid.pattern.source
61-
: isValid.pattern
62-
: undefined;
58+
let pattern;
59+
if ( isValid?.pattern ) {
60+
pattern =
61+
isValid.pattern instanceof RegExp
62+
? isValid.pattern.source
63+
: isValid.pattern;
64+
}
6365

6466
return (
6567
<ValidatedInputControl

0 commit comments

Comments
 (0)