UNPKG

typed-openapi

Version:
8 lines (5 loc) 396 B
import type { LibSchemaObject } from "./types.ts"; export type SingleType = Exclude<LibSchemaObject["type"], any[] | undefined>; export const isPrimitiveType = (type: unknown): type is PrimitiveType => primitiveTypeList.includes(type as any); const primitiveTypeList = ["string", "number", "integer", "boolean", "null"] as const; export type PrimitiveType = (typeof primitiveTypeList)[number];