// tracing: off import { pipe } from "@effect-ts/core/Function" import * as S from "../_schema.js" import * as Th from "../These.js" import { refinement } from "./refinement.js" import type { DefaultSchema } from "./withDefaults.js" import { withDefaults } from "./withDefaults.js" export const objectIdentifier = S.makeAnnotation<{}>() export const object: DefaultSchema = pipe( refinement( (u): u is {} => typeof u === "object" && u != null, v => S.leafE(S.parseObjectE(v)) ), S.constructor((s: {}) => Th.succeed(s)), S.arbitrary(_ => _.object()), S.encoder(_ => _), S.mapApi(() => ({})), withDefaults, S.annotate(objectIdentifier, {}) )