Skip to main content
Module

x/fun/mod.ts>json_schema.literal

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function json_schema.literal
import { json_schema } from "https://deno.land/x/fun@v.2.0.0-alpha.11/mod.ts";
const { literal } = json_schema;

Creates a JsonBuilder over a tuple of literals

Examples

Example 1

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

// schema === { enum: [1, 2, "hello"] }
const schema = J.print(J.literal(1, 2, "hello"));

Type Parameters

A extends NonEmptyArray<Literal>

Parameters

...literals: A