UNPKG

@nestjs/swagger

Version:

OpenAPI for NestJS: generate the API document from controllers and decorators, serve Swagger UI, and derive request types with mapped types.

10 lines (9 loc) • 398 B
import isFunction from 'es-toolkit/compat/isFunction'; import { BUILT_IN_TYPES } from '../services/constants.js'; const PRIMITIVE_TYPE_NAMES = ['string', 'number', 'integer', 'boolean']; export function isBuiltInType(type) { return isFunction(type) && BUILT_IN_TYPES.some((item) => item === type); } export function isPrimitiveTypeName(type) { return PRIMITIVE_TYPE_NAMES.includes(type); }