Skip to content

Commit

Permalink
Use includes instead of regexp.test
Browse files Browse the repository at this point in the history
Signed-off-by: Cédric Boirard <[email protected]>
  • Loading branch information
triozer committed Nov 28, 2024
1 parent 4d97a58 commit f7f8b8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/google-sheets/src/pages/MapSheetFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const inferFieldType = (cellValue: CellValue): CollectionFieldType => {
const cellValueLowered = cellValue.trim().toLowerCase()

// If the cell value contains a newline, it's probably a formatted text field
if (/\n/.test(cellValueLowered)) return "formattedText"
if (cellValueLowered.includes("\n")) return "formattedText"
if (/^\d{1,2}\/\d{1,2}\/\d{4}/.test(cellValueLowered)) return "date"
if (/^#[0-9a-f]{6}$/.test(cellValueLowered)) return "color"
if (/<[a-z][\s\S]*>/.test(cellValueLowered)) return "formattedText"
Expand Down

0 comments on commit f7f8b8b

Please sign in to comment.