Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected updateSelectionContextKeys(): void {
this.contextKeyService.explorerResourceIsFolder.set(DirNode.is(this.model.selectedNodes[0]));
}
export function is(node: Object | undefined): node is WorkspaceRootNode {
return DirNode.is(node) && WorkspaceNode.is(node.parent);
}
protected getClassNames(element: URI | URIIconReference | FileStat | FileStatNode | WorkspaceRootNode): string[] {
if (WorkspaceRootNode.is(element)) {
const name = this.labelProvider.getName(element);
if (element.expanded) {
return [this.rootFolderExpandedIcon, this.expandedFolderNameIcon(name)];
}
return [this.rootFolderIcon, this.folderNameIcon(name)];
}
if (DirNode.is(element)) {
if (element.expanded) {
const name = this.labelProvider.getName(element);
return [this.folderExpandedIcon, this.expandedFolderNameIcon(name)];
}
return this.getFolderClassNames(element);
}
if (FileStatNode.is(element)) {
return this.getFileClassNames(element, element.fileStat.uri);
}
if (FileStat.is(element)) {
if (element.isDirectory) {
return this.getFolderClassNames(element);
}
return this.getFileClassNames(element, element.uri);
}
if (URIIconReference.is(element)) {