displace-comments
Version:
Replace the comment with an equal amount of space from the code string
17 lines (15 loc) • 417 B
TypeScript
type CommentType = "single" | "multiple" | "html" | "custom";
interface MatchItem {
start: string;
end: string | RegExp;
type?: CommentType;
}
interface DetailItem {
start: number;
end: number;
text: string;
type: CommentType;
}
declare function displace(code: string, m?: MatchItem): string;
declare function parse(code: string, m?: MatchItem): DetailItem[];
export { displace, parse };