Skip to main content
Module

x/fun/mod.ts>json_schema.tuple

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function json_schema.tuple
import { json_schema } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { tuple } = json_schema;

Creates a JsonBuilder of a tuple with values that match the supplied JsonBuilders

Examples

Example 1

import * as J from "./json_schema.ts";
import { pipe } from "./fn.ts";

// schema === { type: "array", items: [
//   { type: "number" },
//   { type: "string" }
// ] }
const schema = J.print(J.tuple(J.number(), J.string()));

Type Parameters

A extends any[]

Parameters

...items: [K in keyof A]: JsonBuilder<A[K]>

Returns

JsonBuilder<[K in keyof A]: A[K]>