ts5deco-express-controller
Version:
TypeScript 5 Modern Decorator Express Controller Framework
33 lines • 1.24 kB
TypeScript
/**
* OpenAPI 경로를 Express 경로로 변환하는 유틸리티
*/
/**
* OpenAPI 경로를 Express 경로로 변환
* 예: '/users/{id}' -> '/users/:id'
* 예: '/users/{userId}/posts/{postId}' -> '/users/:userId/posts/:postId'
*/
export declare function convertOpenApiPathToExpressPath(openApiPath: string): string;
/**
* Express 경로를 OpenAPI 경로로 변환 (역변환)
* 예: '/users/:id' -> '/users/{id}'
*/
export declare function convertExpressPathToOpenApiPath(expressPath: string): string;
/**
* 경로에서 파라미터 이름들을 추출
* 예: '/users/{id}/posts/{postId}' -> ['id', 'postId']
*/
export declare function extractPathParameterNames(openApiPath: string): string[];
/**
* 경로가 유효한 OpenAPI 경로 형식인지 검증
*/
export declare function isValidOpenApiPath(path: string): boolean;
/**
* 경로 매칭을 위한 정규식 생성
* Express 경로 매칭과 유사한 기능
*/
export declare function createPathMatcher(openApiPath: string): RegExp;
/**
* 실제 경로에서 파라미터 값을 추출
*/
export declare function extractPathParameterValues(openApiPath: string, actualPath: string): Record<string, string>;
//# sourceMappingURL=openapi-path-converter.d.ts.map