(row: Row, tableId: Id, rowId?: Id)
| 493 | : encodeIfJson(value); |
| 494 | |
| 495 | const addDefaultsToRow = (row: Row, tableId: Id, rowId?: Id): Row => { |
| 496 | ifNotUndefined( |
| 497 | mapGet(tablesSchemaRowCache, tableId), |
| 498 | ([rowDefaulted, rowNonDefaulted]) => { |
| 499 | collForEach(rowDefaulted, (cell, cellId) => { |
| 500 | if (!objHas(row, cellId)) { |
| 501 | row[cellId] = cell; |
| 502 | ifNotUndefined(rowId, (rowId) => |
| 503 | setAdd( |
| 504 | mapEnsure( |
| 505 | mapEnsure(defaultedCells, tableId, mapNew<Id, IdSet>), |
| 506 | rowId, |
| 507 | setNew<Id>, |
| 508 | ), |
| 509 | cellId, |
| 510 | ), |
| 511 | ); |
| 512 | } |
| 513 | }); |
| 514 | collForEach(rowNonDefaulted, (cellId) => { |
| 515 | if (!objHas(row, cellId)) { |
| 516 | cellInvalid(tableId, rowId, cellId); |
| 517 | } |
| 518 | }); |
| 519 | }, |
| 520 | ); |
| 521 | return row; |
| 522 | }; |
| 523 | |
| 524 | const addDefaultsToValues = (values: Values): Values => { |
| 525 | if (hasValuesSchema) { |
no test coverage detected
searching dependent graphs…