Skip to content

Commit 36ec85d

Browse files
committed
nits
1 parent 3b7da4f commit 36ec85d

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

packages/ts-autocomplete/src/index.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,13 @@ function getVirtualLanguageService(
114114
}
115115
},
116116
readDirectory: (...args) => {
117-
if (fallbackServiceHost && fallbackServiceHost.readDirectory) {
118-
return fallbackServiceHost.readDirectory(...args);
119-
}
120-
return [];
117+
return fallbackServiceHost?.readDirectory?.(...args) ?? [];
121118
},
122119
directoryExists: (...args) => {
123-
if (fallbackServiceHost && fallbackServiceHost.directoryExists) {
124-
return fallbackServiceHost.directoryExists(...args);
125-
}
126-
return false;
120+
return fallbackServiceHost?.directoryExists?.(...args) ?? false;
127121
},
128122
getDirectories: (...args) => {
129-
if (fallbackServiceHost && fallbackServiceHost.getDirectories) {
130-
return fallbackServiceHost.getDirectories(...args);
131-
}
132-
return [];
123+
return fallbackServiceHost?.getDirectories?.(...args) ?? [];
133124
},
134125
log: (...args) => debugLog(args),
135126
trace: (...args) => debugTrace(args),

0 commit comments

Comments
 (0)