( sheetDefinitions: SheetDefinition[], mappings: ColumnMapping[] )
| 186 | } |
| 187 | |
| 188 | export function areAllRequiredMappingsSet( |
| 189 | sheetDefinitions: SheetDefinition[], |
| 190 | mappings: ColumnMapping[] |
| 191 | ) { |
| 192 | for (const sheet of sheetDefinitions) { |
| 193 | for (const column of sheet.columns) { |
| 194 | if (fieldIsRequired(column) && allowUserToMapColumn(column)) { |
| 195 | const mapping = mappings.find( |
| 196 | (m) => m.sheetId === sheet.id && m.sheetColumnId === column.id |
| 197 | ); |
| 198 | |
| 199 | if (mapping == null) { |
| 200 | return false; |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | return true; |
| 207 | } |
no test coverage detected