displace-comments
Version:
Replace the comment with an equal amount of space from the code string
34 lines (29 loc) • 585 B
Markdown
提取文本中的注释,并将注释替换为等价的空格
- html注释
- JavaScript单行、多行注释和注解
```js
npm i displace-comments
```
```ts
interface IdisplaceComments{
(code:string,m?:{
start: string;
end: string | RegExp;
type?: "single" | "multiple" | "html" | "custom";
}):{
strippedCode: string;
detail: DetailItem[];
}
}
import displaceComments from 'displace-comments'
const code = ''
displaceComments(code[,options])
```
见test.js的执行结果
MIT