lemon-devkit
Version:
Lemon Serverless Micro-Service Platform for local development
20 lines (19 loc) • 1.06 kB
TypeScript
import type { DerivationInput } from './types';
export type { DerivationInput } from './types';
/** `&`, `|`, `<`, `.` 등이 없는 단순 identifier 여부 */
export declare const isSimpleIdentifier: (typeArgText: string) => boolean;
/**
* 호출 위치의 기본 이름을 생성한다. (충돌 처리 전)
* - 단순 identifier type arg => camelCase(typeArg)
* - 복합 type arg(intersection/union 등) => camelCase(enclosingContext) + 'Mix'
* - enclosingContext 없음 => camelCase(fileStem) + 'Mix'
*/
export declare const baseName: (input: DerivationInput) => string;
/** 기본 이름이 충돌할 때, 경로 prefix를 붙여 한번 더 구분 */
export declare const prefixWithPath: (base: string, relPath: string) => string;
/**
* `taken` 집합 안에서 최종 unique 이름을 확정한다.
* - `taken`은 caller가 전체 호출 위치 기준으로 누적 관리한다.
* - 기본 이름 -> 경로 prefix -> hash 순서로 충돌을 줄인다.
*/
export declare const deriveName: (input: DerivationInput, taken: Set<string>) => string;