From 0111497fc98d5098f81bc749f77da5734add37bb Mon Sep 17 00:00:00 2001 From: Anthony Van de Gejuchte Date: Sat, 3 Sep 2016 23:26:31 +0200 Subject: Make all comment options in cli available in js api Also removing more code within "loop" while at it. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 4f5b21a0..e0aa4ba9 100644 --- a/README.md +++ b/README.md @@ -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. -- cgit v1.2.3