Skip to main content
Module

x/enzastdlib/schema/types.ts>TypeOfSchemaType

enzastdlib is a set of TypeScript modules that follow a common design API philosophy aiming at sane defaults and ease-of-use targeting the Deno TypeScript runtime.
Latest
type alias TypeOfSchemaType
import { type TypeOfSchemaType } from "https://deno.land/x/enzastdlib@v0.0.4/schema/types.ts";

Returns the JavaScript type of the specified JSON Schema type.

Examples

Example 1

import type { TypeOfSchemaType } from 'https://deno.land/x/enzastdlib/schema/mod.ts';

type MySchemaType = 'integer';

type MyType = TypeOfSchemaType<MySchemaType>; // `number`
definition: SchemaType extends "boolean" ? boolean : (SchemaType extends "null" ? null : (SchemaType extends ("integer" | "number") ? number : (SchemaType extends "string" ? string : (SchemaType extends "array" ? unknown[] : (SchemaType extends "object" ? Record<string, unknown> : never)))))