Skip to content

Commit 1de2f87

Browse files
committed
fix: code cleanup
1 parent 5d42564 commit 1de2f87

File tree

1 file changed

+6
-4
lines changed
  • packages/sql-drizzle/src/internal

1 file changed

+6
-4
lines changed

packages/sql-drizzle/src/internal/patch.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ export const makeRemoteCallback = Effect.gen(function*() {
4949
const runPromise = Runtime.runPromise(currentRuntime ? currentRuntime : constructionRuntime)
5050

5151
const finalParams = params.map((e) => {
52+
if (e === null || e === undefined) return e
53+
if (typeof e !== "string") return e
54+
const s = e.trim()
55+
if (!(s.startsWith("{") || s.startsWith("["))) return e
5256
try {
53-
if (e) {
54-
return JSON.parse(e)
55-
}
56-
} catch (err) {
57+
return JSON.parse(s)
58+
} catch {
5759
return e
5860
}
5961
})

0 commit comments

Comments
 (0)