© 2026 Hedgehog Software, LLC
Schema
Decoder
Decoder<unknown, ObjectId>
import * as D from "io-ts/Decoder" import { ObjectId } from "mongodb" export const string: D.Decoder<unknown, ObjectId> = { decode: (u) => { try { const objectId = new ObjectId(u) return D.success(u) } catch { return D.failure(u, "ObjectId") } } }