UNPKG

openapi-ts-mock-generator

Version:
39 lines (37 loc) 1.31 kB
/** * 검증 관련 유틸리티 함수들 */ /** * 값이 null이나 undefined가 아닌지 확인하는 타입 가드 * core/types.ts의 isNotNullish와 동일하지만 utils에서 독립적으로 사용 */ declare const isNotEmpty: <T>(value: T | null | undefined) => value is T; /** * 문자열이 비어있지 않은지 확인 */ declare const isNonEmptyString: (value: any) => value is string; /** * 숫자가 유효한 범위 내에 있는지 확인 */ declare const isInRange: (value: number, min: number, max: number) => boolean; /** * 배열이 비어있지 않은지 확인 */ declare const isNonEmptyArray: <T>(value: any) => value is T[]; /** * 객체가 비어있지 않은지 확인 */ declare const isNonEmptyObject: (value: any) => value is Record<string, any>; /** * HTTP 상태 코드가 유효한지 확인 */ declare const isValidStatusCode: (code: number) => boolean; /** * 파일 확장자가 허용된 목록에 있는지 확인 */ declare const hasValidExtension: (filename: string, allowedExtensions: string[]) => boolean; /** * URL 형식이 올바른지 간단히 확인 */ declare const isValidUrl: (url: string) => boolean; export { hasValidExtension, isInRange, isNonEmptyArray, isNonEmptyObject, isNonEmptyString, isNotEmpty, isValidStatusCode, isValidUrl };