mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-17 12:56:41 +02:00
app: better session id handling
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { dual } from "effect/Function"
|
||||
|
||||
export namespace Optional {
|
||||
export const map = dual<
|
||||
<I, O>(f: (value: I) => O) => (opt: I | undefined) => O | undefined,
|
||||
<I, O>(opt: I | undefined, f: (value: I) => O) => O | undefined
|
||||
>(2, (opt, f) => {
|
||||
if (opt === undefined) return undefined
|
||||
return f(opt)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user