diff options
author | Anthony Van de Gejuchte <anthonyvdgent@gmail.com> | 2016-09-03 23:26:31 +0200 |
---|---|---|
committer | Anthony Van de Gejuchte <anthonyvdgent@gmail.com> | 2016-09-06 17:54:45 +0200 |
commit | 0111497fc98d5098f81bc749f77da5734add37bb (patch) | |
tree | c0d7e4da363639a4c68457d2f90e2eebc61796e8 /README.md | |
parent | 7d8dea3b2675f9d86ea15bb031b7fe166858d67e (diff) | |
download | tracifyjs-0111497fc98d5098f81bc749f77da5734add37bb.tar.gz tracifyjs-0111497fc98d5098f81bc749f77da5734add37bb.zip |
Make all comment options in cli available in js api
Also removing more code within "loop" while at it.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -849,8 +849,10 @@ which we care about here are `source_map` and `comments`. #### Keeping comments in the output In order to keep certain comments in the output you need to pass the -`comments` option. Pass a RegExp or a function. If you pass a RegExp, only -those comments whose body matches the regexp will be kept. Note that body +`comments` option. Pass a RegExp, boolean or a function. Stringified options +`all` and `some` can be passed too, where `some` behaves like it's cli +equivalent `--comments` without passing a value. If you pass a RegExp, +only those comments whose body matches the regexp will be kept. Note that body means without the initial `//` or `/*`. If you pass a function, it will be called for every comment in the tree and will receive two arguments: the node that the comment is attached to, and the comment token itself. |