withNullAsUndefined(x) -> x ?? undefined (#189987)

Follow up on #189983

Replaces `withNullAsUndefined` with uses of `??`
This commit is contained in:
Matt Bierner
2023-08-08 16:45:52 -07:00
committed by GitHub
parent 388d3683ea
commit 6e251255fb
86 changed files with 147 additions and 221 deletions

View File

@@ -15,7 +15,6 @@ import { KeyCode } from 'vs/base/common/keyCodes';
import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { FileAccess, RemoteAuthorities, Schemas } from 'vs/base/common/network';
import * as platform from 'vs/base/common/platform';
import { withNullAsUndefined } from 'vs/base/common/types';
import { URI } from 'vs/base/common/uri';
export function clearNode(node: HTMLElement): void {
@@ -1284,7 +1283,7 @@ export function triggerUpload(): Promise<FileList | undefined> {
// Resolve once the input event has fired once
event.Event.once(event.Event.fromDOMEventEmitter(input, 'input'))(() => {
resolve(withNullAsUndefined(input.files));
resolve(input.files ?? undefined);
});
input.click();