fix(core): clean up Effect audit patterns (#35174)

This commit is contained in:
Kit Langton 2026-07-03 13:54:13 -04:00 committed by GitHub
commit 1b88ff8d53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 118 additions and 62 deletions

View file

@ -1,5 +1,6 @@
import nodePath from "path"
import { customType } from "drizzle-orm/sqlite-core"
import { Schema } from "effect"
import { AbsolutePath } from "../schema"
function storagePath(input: string) {
@ -74,6 +75,8 @@ export const pathColumn = customType<{
},
})
const decodeAbsoluteArray = Schema.decodeUnknownSync(Schema.fromJsonString(Schema.Array(Schema.String)))
export const absoluteArrayColumn = customType<{
data: AbsolutePath[]
driverData: string
@ -86,6 +89,6 @@ export const absoluteArrayColumn = customType<{
return JSON.stringify(input.map(absolute))
},
fromDriver(input) {
return (JSON.parse(input) as string[]).map((item) => AbsolutePath.make(toPlatform(absolute(item))))
return decodeAbsoluteArray(input).map((item) => AbsolutePath.make(toPlatform(absolute(item))))
},
})