(
tableIdOrArgs: Id | SortedRowIdsArgs,
cellId?: Id,
descending?: boolean,
offset = 0,
limit?: number,
)
| 1483 | mapKeys(mapGet(tablesMap, id(tableId))); |
| 1484 | |
| 1485 | const getSortedRowIds = ( |
| 1486 | tableIdOrArgs: Id | SortedRowIdsArgs, |
| 1487 | cellId?: Id, |
| 1488 | descending?: boolean, |
| 1489 | offset = 0, |
| 1490 | limit?: number, |
| 1491 | ): Ids => |
| 1492 | isObject(tableIdOrArgs) |
| 1493 | ? getSortedRowIds( |
| 1494 | tableIdOrArgs.tableId, |
| 1495 | tableIdOrArgs.cellId, |
| 1496 | tableIdOrArgs.descending, |
| 1497 | tableIdOrArgs.offset, |
| 1498 | tableIdOrArgs.limit, |
| 1499 | ) |
| 1500 | : arrayMap( |
| 1501 | slice( |
| 1502 | arraySort( |
| 1503 | mapMap<Id, RowMap, [PrimitiveCellOrValue, Id]>( |
| 1504 | mapGet(tablesMap, id(tableIdOrArgs)), |
| 1505 | (row, rowId) => [ |
| 1506 | isUndefined(cellId) |
| 1507 | ? rowId |
| 1508 | : (mapGet(row, id(cellId)) as PrimitiveCellOrValue), |
| 1509 | rowId, |
| 1510 | ], |
| 1511 | ), |
| 1512 | ([cell1], [cell2]) => |
| 1513 | defaultSorter(cell1, cell2) * (descending ? -1 : 1), |
| 1514 | ), |
| 1515 | offset, |
| 1516 | isUndefined(limit) ? limit : offset + limit, |
| 1517 | ), |
| 1518 | ([, rowId]) => rowId, |
| 1519 | ); |
| 1520 | |
| 1521 | const getRow = (tableId: Id, rowId: Id): Row => |
| 1522 | mapToObj(mapGet(mapGet(tablesMap, id(tableId)), id(rowId)), decodeIfJson); |
no test coverage detected
searching dependent graphs…