CodeQL library for JavaScript/TypeScript
codeql/javascript-all 0.8.13 (changelog, source)
Search

Member predicate Parameter::isDeclaredOptional

Holds if this is a parameter declared optional with the ? token.

Note that this does not hold for rest parameters, and does not in general hold for parameters with defaults.

For example, x, is declared optional below:

function f(x?: number) {}
predicate isDeclaredOptional()