comment-clear
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

comment-clear

install

npm i comment-clear

example

import CommentClear1 from './';
class CommentClear extends CommentClear1 {
    /**
     * if you wanna to keep prefix or suffix symbol you can replace by your self;
     * default to keep \n
     * @param str prefix or suffix
     * @returns replacement
     */
    // n(str: string){
    //     return '';
    // }
}
const clear = new CommentClear();

clear.setPerfix(/\/\//);
clear.setSuffix(/\n/);
const srt = `
{
    ///name
    ///ages
    /*/* age */  /* [1,3,4].map(item =>  n + '        ' + item).join(n) */
    "name": "99"
}
`;
console.log(srt)
const ret = clear.parse(
    srt
)

console.log(ret)

clear.setPerfix(/\/\*/);
clear.setSuffix(/\*\//);
const ret1 = clear.template(ret, { name: 999, age: 77, n: '\n' })

console.log(ret1)

Readme

Keywords

none

Package Sidebar

Install

npm i comment-clear

Weekly Downloads

0

Version

1.0.5

License

ISC

Unpacked Size

17.8 kB

Total Files

7

Last publish

Collaborators

  • adminparry