RSeidelsohn/license-checker-rseidelsohn

The direct option, when using the `init` api seems to be backward

Closed this issue · 2 comments

The typings seem to say it's a boolean but the code seems to check for === 0. Which also seems backwards -- since setting direct to 0 enables direct dependency only output.

I believe that currently the direct option is actually used as the depth of searching. So a depth of 0 gets just the top level, and undefined (or Infinity, which is what is used if direct isn't set), walks the entire tree.

The option gets translated here for the cli, but the api doesn't have this conversion done:

if (parsed.direct) {
parsed.direct = 0;
} else {
parsed.direct = Infinity;
}