Skip to content

Commit 8ad60b1

Browse files
mhartthdxr
authored andcommitted
Use structuredClone instead of remeda's clone (#14351)
Co-authored-by: Dax Raad <d@ironbay.co> Co-authored-by: Dax <mail@thdxr.com>
1 parent 01d5187 commit 8ad60b1

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

packages/opencode/src/cli/cmd/tui/component/prompt/history.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Global } from "@/global"
33
import { Filesystem } from "@/util/filesystem"
44
import { onMount } from "solid-js"
55
import { createStore, produce } from "solid-js/store"
6-
import { clone } from "remeda"
76
import { createSimpleContext } from "../../context/helper"
87
import { appendFile, writeFile } from "fs/promises"
98
import type { AgentPart, FilePart, TextPart } from "@opencode-ai/sdk/v2"
@@ -83,7 +82,7 @@ export const { use: usePromptHistory, provider: PromptHistoryProvider } = create
8382
return store.history.at(store.index)
8483
},
8584
append(item: PromptInfo) {
86-
const entry = clone(item)
85+
const entry = structuredClone(item)
8786
let trimmed = false
8887
setStore(
8988
produce((draft) => {

packages/opencode/src/cli/cmd/tui/component/prompt/stash.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Global } from "@/global"
33
import { Filesystem } from "@/util/filesystem"
44
import { onMount } from "solid-js"
55
import { createStore, produce } from "solid-js/store"
6-
import { clone } from "remeda"
76
import { createSimpleContext } from "../../context/helper"
87
import { appendFile, writeFile } from "fs/promises"
98
import type { PromptInfo } from "./history"
@@ -53,7 +52,7 @@ export const { use: usePromptStash, provider: PromptStashProvider } = createSimp
5352
return store.entries
5453
},
5554
push(entry: Omit<StashEntry, "timestamp">) {
56-
const stash = clone({ ...entry, timestamp: Date.now() })
55+
const stash = structuredClone({ ...entry, timestamp: Date.now() })
5756
let trimmed = false
5857
setStore(
5958
produce((draft) => {

0 commit comments

Comments
 (0)