1

how to check if function parameter is optional using anzlyzer package?

For example:

myFunction(param1, {param2});

I would like to know that param1 is required and param2 is optional

Luis Vargas
  • 2,466
  • 2
  • 15
  • 32

1 Answers1

3

Parameters, if I remember correctly, have a kind getter, which is an instance of ParameterKind, which can be REQUIRED, NAMED or POSITIONAL (also optional).

Tobe Osakwe
  • 729
  • 7
  • 18