Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export function LandingPreviewLogs() {
: MOCK_LOGS

if (!sortKey) return filtered
return filtered.toSorted((a, b) => {
return [...filtered].sort((a, b) => {
const av = sortKey === 'cost' ? a.cost.replace(/\D/g, '') : a[sortKey]
const bv = sortKey === 'cost' ? b.cost.replace(/\D/g, '') : b[sortKey]
const cmp = av.localeCompare(bv, undefined, { numeric: true, sensitivity: 'base' })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function LandingPreviewResource({
: rows

if (!sortColId) return filtered
return filtered.toSorted((a, b) => {
return [...filtered].sort((a, b) => {
const av = a.cells[sortColId]?.label ?? ''
const bv = b.cells[sortColId]?.label ?? ''
const cmp = av.localeCompare(bv, undefined, { numeric: true, sensitivity: 'base' })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function MonitorIcon(props: IconProps) {
return (
<IconFrame {...props}>
{/* Far → near so nearer bars occlude the ones behind them. */}
{MONITOR_BARS.toReversed().map((bar) => (
{[...MONITOR_BARS].reverse().map((bar) => (
<IsoBox key={bar.x} cx={bar.x} topY={bar.ground - bar.h} w={5} h={bar.h} />
))}
</IconFrame>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function escapeRegex(value: string): string {
* names.
*/
function mentionifyPromptForNames(prompt: string, names: readonly string[]): string {
const unique = Array.from(new Set(names.filter((n) => n.trim().length >= 2))).toSorted(
const unique = Array.from(new Set(names.filter((n) => n.trim().length >= 2))).sort(
(a, b) => b.length - a.length
)
if (unique.length === 0) return prompt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function selectComparisonModels(models: CatalogModel[]): CatalogModel[] {
const seen = new Set<string>()
const result: CatalogModel[] = []

const sorted = models.toSorted((a, b) => {
const sorted = [...models].sort((a, b) => {
const score = (m: CatalogModel) => {
const reseller = RESELLER_PROVIDERS.has(m.providerId) ? -50 : 0
const reasoning = m.capabilities.reasoningEffort || m.capabilities.thinking ? 10 : 0
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/(landing)/models/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ const rawProviders = Object.values(PROVIDER_DEFINITIONS).map((provider) => {
models.find((model) => model.id === provider.defaultModel)?.displayName ||
(provider.defaultModel ? formatModelDisplayName(provider.id, provider.defaultModel) : 'Dynamic')

const featuredModels = models.toSorted(compareModelsByRelevance).slice(0, 6)
const featuredModels = [...models].sort(compareModelsByRelevance).slice(0, 6)

return {
id: provider.id,
Expand Down
1 change: 0 additions & 1 deletion apps/sim/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "@sim/tsconfig/nextjs.json",
"compilerOptions": {
"baseUrl": ".",
"lib": ["ES2023", "DOM", "DOM.Iterable"],
"paths": {
"@/*": ["./*"],
"@/components/*": ["components/*"],
Expand Down
Loading