MCPcopy Index your code
hub / github.com/simstudioai/sim / sortRows

Function sortRows

apps/sim/hooks/queries/tables.ts:773–782  ·  view source on GitHub ↗
(rows: TableRow[])

Source from the content-addressed store, hash-verified

771 // would place the new row in a different slot than the server (e.g. an
772 // uppercase-prefixed key), leaving it visibly misordered until next reload.
773 const sortRows = (rows: TableRow[]) =>
774 byKey
775 ? [...rows].sort((a, b) =>
776 (a.orderKey as string) < (b.orderKey as string)
777 ? -1
778 : (a.orderKey as string) > (b.orderKey as string)
779 ? 1
780 : 0
781 )
782 : [...rows].sort((a, b) => a.position - b.position)
783 const fitsAfter = (last: TableRow | undefined) =>
784 last === undefined ||
785 (byKey

Callers 1

reconcileCreatedRowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected