MCPcopy Index your code
hub / github.com/tinyplex/tinybase / getSortedRowIds

Function getSortedRowIds

docs/pseudo.esm.sh/tinybase@9.0.0/index.js:1842–1861  ·  view source on GitHub ↗
(tableIdOrArgs, cellId, descending, offset = 0, limit)

Source from the content-addressed store, hash-verified

1840 const getRowCount = (tableId) => collSize(mapGet(tablesMap, id(tableId)));
1841 const getRowIds = (tableId) => mapKeys(mapGet(tablesMap, id(tableId)));
1842 const getSortedRowIds = (tableIdOrArgs, cellId, descending, offset = 0, limit) => isObject(tableIdOrArgs) ? getSortedRowIds(
1843 tableIdOrArgs.tableId,
1844 tableIdOrArgs.cellId,
1845 tableIdOrArgs.descending,
1846 tableIdOrArgs.offset,
1847 tableIdOrArgs.limit
1848 ) : arrayMap(
1849 slice(
1850 arraySort(
1851 mapMap(mapGet(tablesMap, id(tableIdOrArgs)), (row, rowId) => [
1852 isUndefined(cellId) ? rowId : mapGet(row, id(cellId)),
1853 rowId
1854 ]),
1855 ([cell1], [cell2]) => defaultSorter(cell1, cell2) * (descending ? -1 : 1)
1856 ),
1857 offset,
1858 isUndefined(limit) ? limit : offset + limit
1859 ),
1860 ([, rowId]) => rowId
1861 );
1862 const getRow = (tableId, rowId) => mapToObj(mapGet(mapGet(tablesMap, id(tableId)), id(rowId)), decodeIfJson);
1863 const getCellIds = (tableId, rowId) => mapKeys(mapGet(mapGet(tablesMap, id(tableId)), id(rowId)));
1864 const getCell = (tableId, rowId, cellId) => decodeIfJson(

Callers 1

Calls 9

isObjectFunction · 0.70
arrayMapFunction · 0.70
sliceFunction · 0.70
arraySortFunction · 0.70
mapMapFunction · 0.70
mapGetFunction · 0.70
idFunction · 0.70
isUndefinedFunction · 0.70
defaultSorterFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…