Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use optional chaining for more method calls #156938

Merged
merged 3 commits into from Aug 2, 2022
Merged

Conversation

mjbvz
Copy link
Contributor

@mjbvz mjbvz commented Aug 2, 2022

This rewrites code such as:

if (thing) {
    thing.method();
}

To the more concise:

thing?.method();

This was done using a simple find replace. I tried to keep the change pretty conservative so it only touches simple cases like above

This rewrites code such as:

```ts
if (thing) {
    thing.method();
}
```

To the more concise:

```ts
thing?.method();
```

This was done using a simple find replace. I tried to keep the change pretty conservative so it only touches simple cases like above
@mjbvz mjbvz added this to the August 2022 milestone Aug 2, 2022
@mjbvz mjbvz self-assigned this Aug 2, 2022
@mjbvz mjbvz enabled auto-merge (squash) August 2, 2022 22:32
@mjbvz mjbvz merged commit 342394d into microsoft:main Aug 2, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Sep 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants