Skip to content

Commit

Permalink
feat: add Symbol.isOptional method (#1285)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaharkazaz committed Jun 3, 2022
1 parent 698cf80 commit c7f3512
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/ts-morph/src/compiler/symbols/Symbol.ts
Expand Up @@ -94,6 +94,13 @@ export class Symbol {
return (this.getFlags() & SymbolFlags.Alias) === SymbolFlags.Alias;
}

/**
* Gets if the symbol is optional.
*/
isOptional() {
return (this.getFlags() & SymbolFlags.Optional) === SymbolFlags.Optional;
}

/**
* Gets the symbol flags.
*/
Expand Down

0 comments on commit c7f3512

Please sign in to comment.