@traversable/schema
    Preparing search index...
    • Convert a blob of JSON data into a valibot schema that represents that blob's least upper bound.

      Type Parameters

      • const S

      Parameters

      • json: S

      Returns BaseSchema<S, S, BaseIssue<unknown>>

      import { vx } from '@traversable/valibot'

      let schema = vx.fromConstant({ abc: 'ABC', def: [1, 2, 3] })
      // ^? let schema: v.BaseSchema<
      // { readonly abc: "ABC", readonly def: readonly [1, 2, 3] },
      // { readonly abc: "ABC", readonly def: readonly [1, 2, 3] },
      // v.BaseIssue<unknown>
      // >

      console.log(vx.toString(schema))
      // =>
      // v.object({
      // abc: v.literal("ABC"),
      // def: v.tuple([
      // v.literal(1),
      // v.literal(2),
      // v.literal(3)
      // ])
      // })
    • Convert a blob of JSON data into a valibot schema that represents that blob's least upper bound.

      Parameters

      Returns AnyValibotSchema

      import { vx } from '@traversable/valibot'

      let schema = vx.fromConstant({ abc: 'ABC', def: [1, 2, 3] })
      // ^? let schema: v.BaseSchema<
      // { readonly abc: "ABC", readonly def: readonly [1, 2, 3] },
      // { readonly abc: "ABC", readonly def: readonly [1, 2, 3] },
      // v.BaseIssue<unknown>
      // >

      console.log(vx.toString(schema))
      // =>
      // v.object({
      // abc: v.literal("ABC"),
      // def: v.tuple([
      // v.literal(1),
      // v.literal(2),
      // v.literal(3)
      // ])
      // })
    Index

    Properties

    Properties

    writeable: (json: Json.Fixpoint) => string

    Convert a blob of JSON data into a stringified valibot schema that represents that blob's least upper bound.

    import { vx } from '@traversable/valibot'

    let ex_01 = vx.fromConstant.writeable({ abc: 'ABC', def: [1, 2, 3] })

    console.log(ex_01)
    // => v.object({ abc: v.literal("ABC"), def: v.tuple([v.literal(1), v.literal(2), v.literal(3)]) })