fix(core): clean up Effect audit patterns (#35174)
This commit is contained in:
parent
08293e74a0
commit
1b88ff8d53
18 changed files with 118 additions and 62 deletions
|
|
@ -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))))
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue