mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-18 03:41:44 +03:00
13 lines
385 B
TypeScript
13 lines
385 B
TypeScript
|
import { MinimalBrainForUser } from "@/lib/context/BrainProvider/types";
|
||
|
|
||
|
export const sortBrainsByName = (
|
||
|
minimalBrains: MinimalBrainForUser[]
|
||
|
): MinimalBrainForUser[] => {
|
||
|
// Use the sort method to sort the array by the 'name' property
|
||
|
const sortedMinimalBrains = minimalBrains
|
||
|
.slice()
|
||
|
.sort((a, b) => a.name.localeCompare(b.name));
|
||
|
|
||
|
return sortedMinimalBrains;
|
||
|
};
|