(tableId, rowId, row, skipDefaults)
| 1128 | () => cellInvalid(tableId) |
| 1129 | ); |
| 1130 | const validateRow = (tableId, rowId, row, skipDefaults) => objValidate( |
| 1131 | skipDefaults ? row : addDefaultsToRow(row, tableId, rowId), |
| 1132 | (cell, cellId) => ifNotUndefined( |
| 1133 | getValidatedCell(tableId, rowId, cellId, cell), |
| 1134 | (validCell) => { |
| 1135 | row[cellId] = validCell; |
| 1136 | return true; |
| 1137 | }, |
| 1138 | () => false |
| 1139 | ), |
| 1140 | () => cellInvalid(tableId, rowId) |
| 1141 | ); |
| 1142 | const getValidatedCell = (tableId, rowId, cellId, cell) => hasTablesSchema ? ifNotUndefined( |
| 1143 | mapGet(mapGet(tablesSchemaMap, tableId), cellId), |
| 1144 | (cellSchema) => isNull(cell) ? cellSchema[ALLOW_NULL] ? cell : cellInvalid(tableId, rowId, cellId, cell, cellSchema[DEFAULT]) : getCellOrValueType(cell) === cellSchema[TYPE] ? encodeIfJson(cell) : isJsonType(cellSchema[TYPE]) && isEncodedJson(cell) ? cell : cellInvalid( |
no test coverage detected
searching dependent graphs…