(row, tableId, rowId)
| 1168 | () => valueInvalid(valueId, value) |
| 1169 | ) : isUndefined(getCellOrValueType(value)) ? valueInvalid(valueId, value) : encodeIfJson(value); |
| 1170 | const addDefaultsToRow = (row, tableId, rowId) => { |
| 1171 | ifNotUndefined( |
| 1172 | mapGet(tablesSchemaRowCache, tableId), |
| 1173 | ([rowDefaulted, rowNonDefaulted]) => { |
| 1174 | collForEach(rowDefaulted, (cell, cellId) => { |
| 1175 | if (!objHas(row, cellId)) { |
| 1176 | row[cellId] = cell; |
| 1177 | ifNotUndefined( |
| 1178 | rowId, |
| 1179 | (rowId2) => setAdd( |
| 1180 | mapEnsure( |
| 1181 | mapEnsure(defaultedCells, tableId, mapNew), |
| 1182 | rowId2, |
| 1183 | setNew |
| 1184 | ), |
| 1185 | cellId |
| 1186 | ) |
| 1187 | ); |
| 1188 | } |
| 1189 | }); |
| 1190 | collForEach(rowNonDefaulted, (cellId) => { |
| 1191 | if (!objHas(row, cellId)) { |
| 1192 | cellInvalid(tableId, rowId, cellId); |
| 1193 | } |
| 1194 | }); |
| 1195 | } |
| 1196 | ); |
| 1197 | return row; |
| 1198 | }; |
| 1199 | const addDefaultsToValues = (values) => { |
| 1200 | if (hasValuesSchema) { |
| 1201 | collForEach(valuesDefaulted, (value, valueId) => { |
no test coverage detected
searching dependent graphs…